True statement 2 false test test conditionn

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: uot;,year); printf("%d ? else else printf("%d is not leap year.",year); printf("%d Statement-1 } else { else if((year % 4) == 0) if((year printf("%d is leap year.",year); printf("%d else else printf("%d is not leap year.",year); printf("%d } getch(); getch(); } nested if…else: Entry False Test condition1 condition1 ? False Statement-3 Statement-2 Next statement if…else…if : if…else…if Entry Test Test condition1 condition1 ? True Statement-1 False Test Test condition2 condition2 ? True Statement-2 False Test Test conditionN conditionN ? True Statement-N Next statement /* program to print the grade of student */ #include<stdio.h> int main() { int marks; int printf("Enter marks ? "); printf("Enter scanf("%d", &marks); scanf("%d", if(marks >= 75) if(marks printf("Distinction"); printf("Distinction"); else if(marks >= 60) else printf("First class"); printf("First else if(marks >= 50) else printf("Second class"); printf("Second else if(marks >= 35) else printf("Third class"); printf("Third else else printf("Failed"); printf("Failed"); } switch statement : switch Entry switch switch expression expression ? value1 value2 valueN ……... associ...
View Full Document

This note was uploaded on 11/15/2011 for the course ECKOW 123 taught by Professor Riuyt during the Spring '11 term at University of Damascus.

Ask a homework question - tutors are online