C Tutorials
| First Program "Hello World" |
#include <stdio.h>
void main()
{
/*Comment Line*/
printf("\nHello World");
}
Above program consist of following details:
1. The first line of the program #include <stdio.h> is a preprocessor command which tells C compiler to include stdio.h header file into program before compilation.
2. The next line void main() is the main function where program execution begins.
3. The next line /*...*/ will be ignored by the compiler and it has been put to add additional comments in the program. So such lines are called comments in the program.
4. The next line printf(...) is another function available in C which print the message "Hello World" to be displayed on the screen.
| Compile and Run C Program |
In most of the editor following set of commands use to compile and run a C program.
1. After writing complete program Press "F9" for compilation.
2. The compiler will compile all the code and shows the compilation result. It shows the number of lines compiled, no. of errors with warning messages.
3. If there is no error then we can go for run by pressing "CTRL+F9". This command also compiles the program before run.
4. For output result Press "ALT+F5".

No comments:
Post a Comment