Lecture 3
Lecture 3
Instructions as statements
Order of statements
Each statement must end with a ;
Blanks for readability or clarity
Case-Sensitive
1
Variable Declaration
2
2
Output function
printf ( "<format string>", <list of variables> ) ;
<format string> can contain,
Format String Identifier
Single Character %c
Integer %d
Float %f
Double %lf
3
Examples
4
4
Gross salary C Program
5
Input
To make gross salary calculation program general,
the program ask the user to input value of hours
and payrate during execution
scanf function is used to input value from user during
program execution
6
Gross salary C Program
7
Input function syntax
8
9
End