If student’s grade is greater than or equal to 60
Print “Passed”
else
Print “Failed”
prints Passed if the student’s grade is greater than or equal to 60 and Failed if the student’s grade is less than 60. In either case, after printing occurs, the next pseudocode statement in sequence is “performed.” The body of the else is also indented.
The preceding pseudocode If…else statement may be written in C as
Syntax:
if(condition)
{
statements;
}
else
{
statements;
}
Example:
if ( grade >= 60 )
{
printf( "Passed" );
}
else
{
printf("Failed");
}
Nice work
ReplyDeleteiTS VERY HELPFUL
ReplyDelete