Tag: Decision Making Statements in C++

Exercise # 04 Decision Making Statements in C++

Q: 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. Answer: #include <iostream.h> #include <conio.h> void main() { float varP, varI, varR; cout<<“Enter the […]

Posted in: C++ Exercises

Exercise # 03 Decision Making Statements in C++

Q: 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” […]

Posted in: C++ Exercises

Exercise # 02 Decision Making Statements in C++

Q: 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” […]

Posted in: C++ Exercises

Exercise # 01 Decision Making Statements in C++

Q: Write a program that determines the year entered by user is leap year or not? Answer: #include <iostream.h> #include <conio.h> void main() { int leapyear; cout<<“Enter the year: “; cin>>leapyear; if(leapyear%4==0) cout<<leapyear<<” is leap year”; else cout<<leapyear<<” is not leap year”; getch(); }

Posted in: C++ Exercises

Decision Making Statements in C++

Decision making statements are the statements which take the decisions to make the conditions satisfied and execute their body. If the condition is satisfied (True) then the statement will cause its body to be executed and if the condition is not satisfied (False) then the control will be transferred to the next condition or to […]

Posted in: C++ Basics

if Statement in C++

It is the simplest decision making/conditional statement. The if statement contains the keyword if which is predefined in C++ followed by the condition in the parentheses () with some relational and logical operators.

Posted in: C++ Basics

Example Program for if Statement in C++

This is example program for understanding if statement in C++.

Posted in: C++ Basics

if-else Statement in C++

The if-else statement is another decision making statement. The if-else statement contains the keywords if and else which are predefined in C++. The condition is contained in the parentheses () after the keyword if.

Posted in: C++ Basics
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 .