-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path(E).Conditionals.cpp
More file actions
50 lines (47 loc) · 1.2 KB
/
Copy path(E).Conditionals.cpp
File metadata and controls
50 lines (47 loc) · 1.2 KB
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
//
// main.cpp
// Conditionals & loops
//
// Created by Bharat Oraon on 24/01/21.
//
// Compare Two Number
#include <iostream>
using namespace std;
int main() {
int a,b;
cout << "Enter The First Number : " << endl;
cin>>a;
cout << "Enter The Second Number : " << endl;
cin >>b;
if (a==b){
cout << "The Number You Entered are Equal" << endl;
}
else{
if(a>b){
cout << "The Number You Entered is Greater Than second Number" << endl;
}
else{ cout << "The Number You Entered is Less Than Second Number" << endl;
}
}
cout << "____________________________________________________________________" <<endl;
int n;
cout <<"Enter The Number : " << endl;
cin >>n;
if (n%2==0){
cout << "The Number is Even" << endl;
}
else if(n%2!=0) {
cout << "The Number is Odd" << endl;
}
cout << "____________________________________________________________________" <<endl;
char c;
cout << "Enter a Character : " << endl;
cin >> c;
if (c>=65&&c<=90){
cout << "1" <<endl;
}
else if(c>=97&& c<=122){
cout << "0" << endl;
}
else {cout << "-1" << endl;}
}