Professional Documents
Culture Documents
Structures
Algorithm
if ( grade >= 60 ) {
printf( "Passed\n" );
} /* end if */
Nested if…else statements
Product = 3;
while ( product <= 100 )
{
product = 3 * product;
} /* end while */
Counter Control Repitition
A class of ten students took a quiz. The grades (integers in the range 0 to
100) for this quiz are available to you. Determine the class average on the
quiz.
Write a Program???
Class average program with sentinel-
controlled repetition
Write a program to calculate average using sentinel-controlled repetition ??
c = c + 3;
can be abbreviated with the addition assignment operator += as
c += 3;
Increment and Decrement Operators