0% found this document useful (0 votes)
3 views

Lecture 2 Write Your First Program in C++

The document appears to be a tutorial on programming basics, specifically focusing on C++ syntax and data types. It covers topics such as variable declaration, data storage, and basic operations, including arithmetic and relational operators. Additionally, it includes examples of code snippets and explanations of how data is represented in memory.

Uploaded by

shahrearabedin.b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lecture 2 Write Your First Program in C++

The document appears to be a tutorial on programming basics, specifically focusing on C++ syntax and data types. It covers topics such as variable declaration, data storage, and basic operations, including arithmetic and relational operators. Additionally, it includes examples of code snippets and explanations of how data is represented in memory.

Uploaded by

shahrearabedin.b
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Lectura -02

Frst freoram
goting started M.E formot

code orplea (Tcun

plony) CNCtable
/1
Jorvmot GBinay
Lang
b-2

Compilen TDE sctup


CompilareLTrans lation TDE - Intena tod Develeprrt
Environment
Ly fnd enor6
e4: Code Blocks
V6 codesh
Raptit

() Print Namaste Dunia


ello vonld startof
Prupran int main()
Jbschart:
(stan)
eades inbe
1 nt main
bprint "Namaste. Dunia"
cout
nanespace
want to use. eoot of std
Variables cout <<

type varabe compilation


eutor

Snew line or
ent"
Same
inside
memorry +0 to end ire/
state - mont
Schac eh -

ch
emoy
1 bte 8 bit

True 1
False O

float
loat 4 =12 ;

8 bate
double doublo d = 133; |1.23
Vaniabb Nae
abe 1ab)D
ABC abl
A1
A_1

Hos doteis stored?


int a=8Binaty 1000

4yte
0000 o0 00 1000

32 bi
jnt a=5 101
3bit O000 O000 O000 ol01

-ve numbae?)

(eharr ch= 'a';) ASCIT table

i byte

(o/) 8bil- ch
32 bi4 int )

32 101 28 4 t chau. or int ?


ans:
atatype
int a= 123;
(a97)
int a a';
same
output

chan eh= 98;

inteqen - 1 bte ’ 32 bit

max
min = 0
aha ch >i byte ’8it

/g1< max
Omyn

123 45G
last bit a int
Valu tore
chat
nums. oute storod
Hoa vogalve
First bit nclicate e
Ly ve 0

tmore the -ve


y omerd into binany rapresntabion.
tale 23 complinent store
Hfonksh
O000 O000 O00 1 0 I t

111| 111 O0

int a - 5

print a-?(oploy
1111 1111 111 10 lL
scomp: O000 O000 O000 O90000

O000 OO00 0000 01ol


uhy ue neod 23 compi mort ?
2

-(2)

O, -0 1¾ number t ruprCSent o oft teqrik

>dcfault
int = 1, -
|O...

Sunsgned int -2
Opanatons (% modlelo
Arithmaie
’0. 4

o.40
lool/n Fbat
doublecbuble
Ralational cparators
a=3
b= 4

asb

a<=b

int a =3;
vEnt

25| 6 t|| 80
pt 'normol'.
eanot of a

Bilise opariatos

Loancd
50mpilation
1st prgram
’ Líine by ine ouplaiakon
’Data ypes/Vamiolles
practhee
note

You might also like