If-else Program In C++

Words
41
Reading
1 min
Listen
Play
9y

Simple If else program in C++ where program it ask user to enter age at runtime and then it will then that you are young or old.

https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcROE7cWnPHNY74m_z2h6sdOqO0beP3h_dvoJlGXfXldE9kZ1a8lHA

#include < iostream>

using namespace std;

int main()
{
int age;

cout<<"Please input your age: ";
cin>> age;

if ( age <= 30 ) {
cout<<"You are pretty young!\n";

}
else {
cout<<"You are really old\n";
}

}

If-else Program In C++ | Ecency