Skip to main content

A simple C program

Now lets start with a simplest C program in this post.
Read the program carefully and try to understand the meaning of each statement.

Sample Program:


/* Lets begin programming */

main()

{

printf("Hi people .This is our first C program \n");

}



Explaination of the above program:

Every C program must start with the main()function.
The ';' is used as a statement terminator in C.
{ } marks the beginning and the end of a function.
/* */ encloses comments if any.
printf() is a C function for displaying variable or constant.
\n is the escape sequence for new line.

I run this program on C blocks software and here is the Output:



Sounds easy,right?
Still any question post it to the comment box.I'll be happy to resolve them.

Comments

Unknown said…
I have a problem when i press ctrl+f9
I got an error Function 'print f' should have a prototype
and i cant open full screen compiler.
pls reply me
my id is vishalpatel1984@ymail.com