By 25/02/2014 9 Comments

Exercises for Decision Making Statements in C++

1. Write a program that determines the year entered by user is leap year or not?

Click Here for Answer

2. Write a program which gives the following output
Enter age>>
And prints the following:
If Age is greater than 45 then prints the message “You are old stay at home and wait for call”
If Age is greater than 30 and less than 45 then prints “Hey! man enjoy your life with your kids”
If Age is greater than 20 and less than 30 then prints “Cool! have a search for your best suit”
If Age is greater than 10 and less than 20 then prints “Work hard! Your days to study”
If Age is less than 10 then prints the message “Oh! Kid your days to cry”
Use if-else statement.

Click Here for Answer

3. Write the above program #02 by using the switch statement?

Click Here for Answer

4. Develop a C++ program which will compute the power dissipation of a resistor, when the user inputs current value and the resistance. Program warns the user if power dissipation is above 1 watt. The power dissipation is measured by P=I2R.

Click Here for Answer







Posted in: C++ Basics

Leave your valuable Comment

Have a natural attraction for women cosmetics and replica watches uk clothes, no
more than two for men the most attractive one, is to make their own driving experience, happy and can serve as the facade of the car, another is to highlight the taste edify sentiment rolex replica watch. The replica rolex is undoubtedly the most fashionable accessories, wear a suit to attend the activities, but also get a decent match on the replica watches .