Sample Program - 1

main( ) 
{
        /*........................ print a message........................*/

        printf("I am new to C Programming. I am learning it.") ;

        /*.........................ptining ends here....................*/ 
}

output -  I am new to C Programming. I am learning it.

main( ) - this is a special function and program execution begins from this function.

 Every program must have exactly one main function.

( ) empty bracket following main show that it is a function and it takes no arguments (parameters).

{ - start of a code block

} - end of a code block 

all the code between { } these curley brackets make the function body.

The lines beginning with /* and ending with */ are called comment lines and are not executed. These comments are used to increase the program readability and understanding.

Comment lines are ignored by the compiler. 

Comments can't be nested means we can't have comments within comment.

Comment does not affect the speed of program and size of the compiled program. 

printf( ) - a pre-defined standard C function for printing output. 




Last modified: Thursday, 18 November 2021, 3:47 PM