forked from ShiqiYu/CPP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
if.cpp
37 lines (31 loc) · 753 Bytes
/
if.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
#include <iostream>
using namespace std;
int main()
{
int num = 10;
if (num < 5)
cout << "The number is less than 5. " << endl;
if (num == 5 )
{
cout << "The number is 5." << endl;
}
else
{
cout << "The number is not 5." << endl;
}
if (num < 5)
cout << "The number is less than 5." << endl;
else if (num > 10)
cout << "The number is greater than 10." << endl;
else
cout << "The number is in range [5, 10]." << endl;
if(num < 20)
if(num < 5)
cout << "The number is less than 5" << endl;
else
cout << "Where I'm?" << endl;
int * p = new int[1024];
if (p)
cout << "Memory has been allocated." << endl;
return 0;
}