Simple if-else program
#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.
thanks for this coding.. happy to see u again..
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i m also a programmer... i like your program
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
ahmm nice brother
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
very nice information
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i love programming
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
keep it up
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit