Conditional Statements

This section contains source codes of many Programs that are the Basics of Programming in C++.

Conditional Statements

Postby MT Shahzad on March 3rd, 2008, 5:36 pm

Some c++ programs to demonstrate the use of conditional states, If & If-else statements.

CPP-007: A C++ Program that reads marks obtained by a student in a test of 100 marks and print pass if marks are greater than or equal to 50.

CPP-008: A C++ Program that reads marks obtained by a student in a test of 100 marks and prints pass if they are grater than 50 and otherwise it prints Fail.

CPP-009: A C++ Program that reads a number and prints even if the number is even and prints odd if the number is odd.

CPP-010: A C++ Program that reads marks obtained by a student in a test of 100 marks and computes his grade according to the following criteria.
Marks>=80 grade=A
Marks>=70 & <80 grade=B
Marks>=60 & <70 grade=C
Marks>=50 & <60 grade=D
Otherwise grade=F [ Using nested if-else notation ].

CPP-011: A C++ Program that reads marks obtained by a student in a test of 100 marks and prints pass if they are grater than 50 and otherwise it prints Fail. [ using compact if-else notation ]

CPP-012: A C++ Program that reads marks obtained by a student in a test of 100 marks,assign and print the grade. if marks are grater than 50, grade=P and otherwise grade=F. [ using compact if-else notation ]

CPP-013: A C++ Program that reads marks obtained by a student in a test of 100 marks and computes his grade according to the following criteria.
Marks>=80 grade=A
Marks>=70 & <80 grade=B
Marks>=60 & <70 grade=C
Marks>=50 & <60 grade=D
Otherwise grade=F [ Using switch-case statements ]

CPP-014: A C++ Program that reads two integers and an operator, evaluates and displays the result. [ using switch-case statements ]
You do not have the required permissions to view the files attached to this post.
MT Shahzad
Web/Software Developer
http://mts.sw3solutions.com
User avatar
MT Shahzad
Site Admin
 
Posts: 300
Joined: February 29th, 2008, 8:11 am
Location: Muridke, Pakistan

Return to Basic Programming

Who is online

Users browsing this forum: No registered users and 0 guests

cron