-
Notifications
You must be signed in to change notification settings - Fork 0
/
lec001.cpp
30 lines (22 loc) · 964 Bytes
/
lec001.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
//BASIC SYNTAX
#include<iostream>
using namespace std;
int main() {
/*
cout<< "hello world" <<endl; / cout<< "hello wolrd\n";
int a = 32; //4 bytes (32bits, no matter how much it take, computer add preceding 0s to fill the space)
char b = 'x'; //1 byte
float x = 1.2; //4 bytes (32bits, no matter how much it take, computer add preceding 0s to fill the space)
double y = 1.23;
bool z = true (printing z will print 1)
int size = sizeof(a);
cout << "size of a is: " << size << "bytes" <<endl;
*/
/*
int a = 'a'; //returns ASCII value of 'a' i.e 97
char x = 98; //returns character for this ASCII
char y = 123456; //large value so it will assign the highest possible value(64) to y
unsigned int a = 876; //using unsigned int rather than int will not allow to store negative number but range will be increased
// int/int=int float/int=float double/int=double
*/
}