This C program starts with #include
The line int main() declares the main function. Every C program must have a function named main somewhere in the code. We will learn more about functions shortly. At run time, program execution starts at the first line of the main function.
In C, the { and } symbols mark the beginning and end of a block of code. In this case, the block of code making up the main function contains two lines.
The printf statement in C allows you to send output to standard out (for us, the screen). The portion in quotes is called the format string and describes how the data is to be formatted when printed. The format string can contain string literals such as "This is output from my first program!," symbols for carriage returns (\n), and operators as placeholders for variables (see below). If you are using UNIX, you can type man 3 printf to get complete documentation for the printf function. If not, see the documentation included with your compiler for details about the printf function.
The return 0; line causes the function to return an error code of 0 (no error) to the shell that started execution. More on this capability a bit later.
Courtesy : http://computer.howstuffworks.com/c3.htm
0 comments:
கருத்துரையிடுக