Basic Syntax of C Program
A C program basically consists of the following parts −- Preprocessor Commands
- Functions
- Variables
- Keywords
- Statements & Expressions
- Comments
#include
int main() {
/* multline comment */
printf("Hello, World! \n");//single line comment
return 0;
}
Preprocessor Commands
Functions
Variables
Keywords
Expressions and Statements
A statement causes the computer to carry out some definite action. There are three different classes of statements in C: expression statements, compound statements, and control statements.
An expression statement consists of an expression followed by a semicolon. The execution of such a statement causes the associated expression to be evaluated. For example:
c = a + b;
++j;
pi = 3.141593;
circumference = 2. * pi * radius;
area = pi * radius * radius;
}
No comments:
Post a Comment
Thank you for your Time. Keep Learning