Showing posts with label Branching Statements. Show all posts
Showing posts with label Branching Statements. Show all posts
Friday, March 28, 2014
Thursday, March 27, 2014
Switch Statement
Output is as :
Enter the Choice from Four Days...
S = Sunday
M = Monday
T = Tuesday
H = Thursday
S
Sunday
Ladder if or else if statement
The marks obtained by a student in 5 different subjects are input through the keyboard. The student gets a division as per the following rules:
=> Percentage above or equal to 60 - First Division
=> Percentage between 50 and 59 - Second Division
=> Percentage between 40 and 49 - Third Division
=> Percentage less than 40 - Fail
Method: 1
Method: 2
=> Percentage above or equal to 60 - First Division
=> Percentage between 50 and 59 - Second Division
=> Percentage between 40 and 49 - Third Division
=> Percentage less than 40 - Fail
Method: 1
Method: 2
nested if statement
/*If the ages of Ram, sham and Ajay are input through the keyboard, write a program to determine the youngest of the three*/
Output is as :
Enter the three Ages of Ram,Sham and Ajay
14
17
19
Ram is Youngest
Output is as :
Enter the three Ages of Ram,Sham and Ajay
14
17
19
Ram is Youngest
Tuesday, March 25, 2014
if-else statement - C Programming
/*Any Number is input through the keyboard. write a program to find out whether It is and Odd Number or Even Number.*/
Output is as :
Enter the Number
4
This is Even Number
Output is as :
Enter the Number
4
This is Even Number
Sunday, November 17, 2013
Subscribe to:
Posts (Atom)