-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
56 lines (45 loc) · 1.17 KB
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include <iostream>
using namespace std;
int main()
{
// cout<<"Hello world!"<<endl;
// cout<<"Next line"<<endl;
// int a, b, c;
// short sa = 9;
// cout << sa;
// camelCase Notation
// int marksInMaths = 83;
// cout << "The marks of the student in maths is " << marksInMaths << endl;
// short a;
// int b = 89;
// long c;
// long long d;
// float const score = 45.32;
// double score2 = 45.322;
// long double score3 = 45.332;
// // score = 34.2;
// cout << "The score is " << score << endl;
// int a,b;
// cout<<"Enter First number:";
// cin>>a;
// cout<<"Enter second number:";
// cin>>b;
// cout<<"a + b is "<<a + b<<endl;
// cout<<"a - b is "<<a - b<<endl;
// cout<<"a * b is "<<a * b<<endl;
// cout<<"a / b is "<<(float) a / b<<endl;
// cout<<"a % b is "<<a % b<<endl;
int age;
cout<<"Enter your age: ";
cin>>age;
if(age>150){
cout<<"Invalid age";
}
else if (age>=18){
cout<<"You can vote!";
}
else{
cout<<"You cannot vote!";
}
return 0;
}