forked from bansalanjali2512/LearnCpp
-
Notifications
You must be signed in to change notification settings - Fork 1
/
literals.cpp
40 lines (32 loc) · 836 Bytes
/
literals.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
#include <iostream>
using namespace std;
int main() {
//Interger Literals
int iLiteral1 = 10;
int iLiteral2 = 10u;
int iLiteral3 = 0x4b;
int iLiteral4 = 10l;
int iLiteral5 = 10ul;
//Floating point literals
float fLiteral1 = 5.6;
float fLiteral2 = 3.14159;
float fLiteral3 = 314159E-5L;
//Boolean literals
bool bLiteral1 = TRUE;
bool bLiteral2 = FALSE;
//Character literals
char cLiteral = 'a';
//String literals
cout << iLiteral1 << " ";
cout << iLiteral2 << " ";
cout << iLiteral3 << " ";
cout << iLiteral4 << " ";
cout << iLiteral5 << " " << "\n";
cout << fLiteral1 << " ";
cout << fLiteral2 << " ";
cout << fLiteral3 << " " << "\n";
cout << bLiteral1 << " ";
cout << bLiteral2 << " " << "\n";
cout << cLiteral;
return 0;
}