+ 1
Guys can you tell me what's wrong with this
#include <iostream> using namespace std; int age; { int age = 75; if( age = > 50) cout << "Senior Citizen "; return 0; }
7 Answers
+ 7
There should be:
cin >> age;
Not:
cin >> "age";
+ 6
1. Program should start with main function.
2. >= instead of =>.
Here's corrected code:
#include <iostream>
using namespace std;
int main()
{
int age = 75;
if(age >= 50)
cout << "Senior Citizen ";
return 0;
}
+ 5
After you declare a variable and before if statement you should put:
cin >> age;
+ 1
#include <iostream>
using namespace std;
int main()
{
int age;
cin >> "age";
if( age > 50)
cout << "Senior Citizen ";
else
cout<< "Adult";
return 0;
} will this work?
+ 1
Thanks a lot
0
Thanks Man
0
How do I incorporate cin to it