Program In C Language :
In the first practical program of this course we have only use simple header and main function and a print function to print something on the screen.below is the code you can see and copy to try it by your own in any C language IDE/editor.
#include<stdio.h> //it is need to run printf() function.
printf("hello world of c. "); //display content inside function
Output : hello world of c.
Explanation of How above program works..
- Every program start from main() function.
- printf() is a library function to display output which only works if #include<stdio.h>is included at the beginning.
- In, stdio.h is a header file (standard input output header file) and #include is command to paste the code from the header file when necessary.When compiler encounters printf() function and doesn’t find stdio.h header file, compiler shows error.
- Code return 0; indicates the end of program. You can ignore this statement but, it is good programming practice to use return 0;
PREVIOUS : Data Types In C Language