C++ if else program

in #program6 years ago

Simple if-else program


Source

#include < iostream>

using namespace std;

int main() // Most important part of the program!

{

int age; // Need a variable...

cout<<"Please input your age: "; // Asks for age

cin>> age; // The input is put in age

if ( age <= 30 ) { // If the age is less than 100

 cout<<"You are pretty young!\n"; // Just to show you it works..

}

else {

cout<<"You are really old\n";     // Executed if no other statement is

}

return 0

}

Output :
Please input your age: 20
You are pretty young!

I hope you like this.

Sort:  

thanks for this coding.. happy to see u again..

i m also a programmer... i like your program

ahmm nice brother

very nice information

i love programming

keep it up

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.032
BTC 60826.65
ETH 2907.17
USDT 1.00
SBD 3.54