A C program basically has the following form:
We must have a main() function.
A function has the form:
type function_name (parameters)
{
local variables
C Statements
}
If the type definition is omitted C assumes that function returns an integer type (integers are treated like index numbers, means, they have no decimal point). NOTE: This can be a source of problems in a program.
So returning to our first C program:
/* Sample program */
main()
{
printf( "I like C but does it like me? \n");
exit(0);
}
NOTE:
Let us look at another printing statement:
printf(".\n.1\n..2\n...3\n");
The output of this would be:
.
.1
..2
...3