This function will also be executed

return the value 0 after execution. Another way you can use void , which means nothing (empty). If we use void, then we don’t need to write return at the end of the function. Because, void does not return any value. Example: void main() { //… } There are several things you need to pay attention to besides the basic structure of C, namely writing statements, code blocks, comments, and case sensitivity. Writing Statements A statement is a command or function to carry out an instruction. For example: printf(“Hello Dicoding!”); The purpose of the program code is to print the program results in the form of the text “Hello Dicoding!” to console . Writing Code Blocks A code block is a collection of statements and expressions . 

Writing Comments on C Program

Code blocks in C are wrapped with { } signs, for example like this: #include <stdio.h> int main(void) { // Di dalam sini adalah blok kode sampai akhir kurung. int z; for  printf(“Hello Dicoding \n”); } return0; } You will later get used to using statements such as if , for , while , while do , function, etc.  Code Comments are also very necessary for some programmers. Why? Because comments will be used as information on a program code. #include <stdio.h> int main() { // ini adalah komentar satu baris printf(“Hello Dicoding!”); /* Ini adalah komentar untuk satu baris atau lebih. */ return 0; } You can try practicing and running the code above. Will comments affect the function of the program code? Of course it will not affect the function of the program. Case is sensitive .

The C language will pay attention

To uppercase and lowercase letters when writing code. This is what is called Case Sensitive. Example: / isalkan kita membuat variabel seperti ini string nama = “Dicoding”; string Nama = “Indonesia”; The two variables “name” and “Name” will be different because they are SV Lists lowercase and uppercase. Actually, we still have a lot to discuss, but for now, let’s finish it first. So you can study at home, I will give you homework. Try writing down the program code and changing it according to your name and address!providing scholarships for online coding training . The aim is to produce young programmers who are ready to compete in today’s digital economic world. This year, Lintasarta also provides graduates of the Lintasarta DigiSchool 2020 program with the opportunity to get advanced scholarships in the Advanced class, namely Becoming a Front-End Web Developer.

Leave a comment

Your email address will not be published. Required fields are marked *