To start programming The most important Syntax of the language, each program will have different Syntax away. And it have a Library,we need to know and use the Library to make it easier.
For C, the Library at the base is stdio.h which time we will use the Library to type # include <Name Library>.
Every time you write a program in C to be the main function. In front function must has datatype.
void data type be does not have a return function.
int,cha,float data type be return a value function
Example 1
# include <stdio.h>
void main () {
printf ("Hello World"); / / printf function from Library stdio.h.
}
Output 1
Hello World / / show "Hello World " on the screen..
Example 2
# include <stdio.h>
int main () {
printf ("Hello World"); / / printf function from Library stdio.h.
return 0 ;/ / the return value of the function.
}
Output 2
Hello World / / show "Hello World " on the screen same Ex1.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น