You are on page 1of 5

C++ LANG UAGE (

High Level pmrommia nguog


FORMAT
i t e cout wAhau td inpud
and oudput
or
US
ncude <iostreo m) 7 Head efile
mespostdentPmt
Inteaesint man stotemandr
v i s i b l om scresn.

giues data to Cau KHelo World" Fun ctiom s


ocput deuics3. retum P
r m o i A n

O alu

OATA TYrES
VARTABLES

ConmoinorS a l doa.
se o e dferet
int a=\
doda pas:
e s ot
t b= 2
int,doole, oot,dho
C=atb

2-S3 .S
CoMMEN TS O
q666
To psaSant
sodemonds uhch 2.6

a r iqoad
Compilar. As
FILES OPeRATORS
HEADER (
<iostream? enhon Cos ciomoliiy ot Propray
Eincuda m e nctions adso- ug the
Content ehaaday ulos
Two TYPES OF HE ADER
FILES
Sstem haodar es1tComas ui4h tho Compileer
compilar
a. Jsor &ft headar s iten o ha prararnae

1 8 t 1ncromardt

13+ docrem&n

hom print
ORERATORS
Arnthe mehe Oppexodors ~ t , , * , /, 7. ( t t -

Reladtonal Speroers ,2<, >=,<=,


cout <<" The uolu a ==bis
<< la=%,
Ceu < The valua ota =b is" <<al=b);

Loqico O\erotors & , \


Hssie nnrendt Cpovasorr
CONSTAN TS
Prrom
may nottalter amd
Fixod vaues ho ne
ahe colled Wterols.
e

MANTPOiATORS
Cemdl) Used tr leam a neu line haracer
i t a 3 , b=13, C= a33,
Cout < " The vale O siheu setw is
Tvo A: 3 a < endl;
TVOAI 18 coust The valu s a witboud ctu is:
TUOA 123>
bendl;
Output cot T o u o a is Setus) Ka <<
TVOR1 end
TVotl
TVotl 1 endli
BASIC INPUT/GOTPOT
Flou inpud and outpud s knoum o eoms.
nput Sbream-Jhon darection ou
dolens daarice.
lplacorom snpd
FOr ecrom P Raooard d nei

Oaspur Streo Gmane direcdion otflo oas


dalkas pocerom moin maynorto
3ha odpsd dsuri Las.
--.

Erampl
#incude <iosthreosm
uSine noma.sloca 8e,
ind main )

int n n 1.,masma
ingerhon Cout
E n t e r n e trolbse nasm : \ ;
operodor
ein n m1
esrockio Cau <4Ender
pradr

um i <4 hum 1
Cout 4"T
IF ELSE C++ -

incude <tostraoum)
usina hamespaco Ste
iv moin )
ent ag
Co "Tell ma
et sq 4end

Caq<1B)
Mou cannot to my
Porhu <Lend
2
else i f Coge = =8)
Coud <<Yo Qre a leid and e uill get a leid
else Poss Pr endl,
-else
adder Coud SOm
Port <<endl;

Switdh Case Stoteme


Suitdb loae)

Cose

Cou A" Mou are 18


breoai
Cose 2 ,
Cout "You are 02
defout
Cou N o S peciad coses
break

Fettrn O
Bptak Conhnue
redoonto
Eincude <iostream?
usina nomaS poco 8td
int main
i+t)
r Cint i=1;i<=40;

) conmtinue
.Chare) and
w a
Conti u a
Breoe
cout <<i (<endl

re nO

Poiuntesct Data typ which holds h


oddress f o a r doda tmeoS.

Eincude <isoam
Sing namsspo.ce std,
int moin C) Valu ad)
mta-3 erence_Of op9rator
o - e i s(Addess oporator eddress te
alhaga
aut ( T h oddress of o io<<koi
Cost <" The oddhesS io < b
Oupc
3

co TRT h valus a ddness nddhQsS


<b<{ endl,

You might also like