The best way to learn C or any programming language is to begin writing programs in it.
Let us write the first program named first.c :
/* A Simple
C Program */
#include
<stdio.h>
int
main(void)
{
printf(“C
is Sea\n”);
return 0;
}
C uses a semicolon as a statement terminator; the semicolon is required as a signal to the compiler to indicate that a statement is complete.
There are a
few important points to note about thisprogram. These are common to all C
programs.
1. In C, the comments can be included in the program. The comment
lines start with /* and terminate with */. These statements can be put anywhere
in the program. The compiler considers these as non-executable statements.
According to C99, a comment also
begins with // and extends up to the next line break. So the comment line can be written as follows:
//
A Simple C Program
A C program basically consists of the following
parts −
·
Preprocessor
Commands
·
Functions
·
Variables
·
Statements
& Expressions
·
Comments
No comments:
Post a Comment