Professional Documents
Culture Documents
It Begi Nning Uwi TH CH ND, Its Teariues) Snet S: Jnngungo
It Begi Nning Uwi TH CH ND, Its Teariues) Snet S: Jnngungo
It Begi Nning Uwi TH CH ND, Its Teariues) Snet S: Jnngungo
uA@a
inaetion /put
inae9ution /putlo"C<<)
Atatamant hat
in the SuAut
cout
Hiad Juben oncsuartior/et From
Jntment
cin JD tha input opartabC )
tnACoda sarde cout
with
with
3 Denived. types
a Oy, tunction, pointes, sekesgenee
in
oules hat ane apliacble fo naming a vagia ble
Variables
Vagiables a
e also agelicable in Ct*
ae
<data-type> list-of-vadiables;
Retevence vaiables
H oh0once dJa9ialla p9BUielon aun alian C culto9untue
name) a p9QLDUAly.
dsinlla JAt e initisoc a tha
.A uleHaNe
ine o} dorlosuation.
data type> TetedeNce name;
couteactendl1/Display
Cout n<Tendl / Dis play
27 May
Eccpme sisith Are hei tupES:12
An ocpotaaaion ip ornluiatisn pOLateno, Lonatant
And Ja9tinlylea n9oangod 0 p0 Bha suulas tha Jangungo
ad
H n ocpsanDi.on may conait eona col Moa NAUneda
Coatont oscpanAion.
Antagoua ocgotannion.
QcpsoADion
Pointo ocAoAOAion
Ralational acpoaRJsn
Lgical acpsOApion.
itwiQ op9IaRai on
Note:- Al spasuntoua C n90 unilnlblo in C++. ie
Agithmoti *
3Annignrnand C 4
Shoot hand/compound assigninent
Ralntional C, >,4, E
Relat ional inenuo lity Reletional eality
Logica C83..!)
Btwise C . 1 , , . )
Trg ue
Teenoany i ? )
Fake
1. Constont erpae ssion -
conninta only Conatart valuon
Sg-14. 2015/2 c
20+2-56 LA65. 1 ASC II values
22-5 a -97 J
Eg:-C+9 gy/10D
hsa.C-3-2.y=&5 C=12-0 y=9-o
9-2t9-5 12-O3O/10
6-7
6-O/10- miteed -mode etuptession
6
4.Pointes epeSsion p9DdurOA Oddtan uuluan a d nat
p9umitile waluea
Eg- k int k SP
int P
addoess of actres ot
P R P
-artdson
b"Kelational erpaession -
5r6 4t8
T6ue I 12 False
APa JJRd, tha will be Oauatd
thos p i t r a t i r . orpoLion
J i a ond h 0Lultn a g a SomRa90c Boo lean ecc pression
6. Logical eopsession- Combino two o MBLO alntinml
ocp9onDioo and podute
Josl ypo
AODult
ga.>b 39 c-=1O
if a 5 b 3 C-9.
hn a>b 6 c 9 False
Hene. if the fi6st crP*SÍon is folse he second expaession
is not evaluated
if a i5 b 3 OC- IO.
hn a b 3 8 Oc = 10 louue
Operatos Ouerloadinq
Ouesuoading M e a a adAigning dita3ort monringa tD
An
JJitwino on9nto
couta Hsa, « Din an inetinn ofaato.
ContwolStouctu res
Entoy
Enty Loop
Enty
TTe False
Action 1 Conditiony
e
ondition* Aetio0 1
Action Action 3
Action 9
imple il stalaman!
i Cere Ssion) selatioial eopsecoio
stotement- block; If toue staternent is erecuted
IF false 6taterert is Skiped
tsuetusecd f atatomont
to ue IF False
Cerp gession)
else
Skips ececutes
false Statement-block;
Nentod itaBomont
if Ccondition)
tbo Jnddos
F Ccondition)
else if Ccondition 2)
Switchh statenert
Switch Ceo paession)
Must evaluate to an int value
e ecorutodd;
/statomand o
do
staternent i
statement 2
statemet n;
uwnile Ctest condition)
ody of he loop is ececutedl one ed move no. of kimes.
29/May
Teem wNork 1
LLa). uloito a Ct+ p9Logouam to Awap tuo Ja9iallon ubing
oLostonte uasialle..
#include< iostoeam
Usingnamespace std;
void eocchange Cint 3. int 8);
int main C)
{
int a.b;
Cout< "Enter two numbers:;
cin > a >b;
cout < " Before exchange a is« a < and b is b <<end
exchange Ca. b);
cout" After escchange 'a i s i a < and b i s <b <<endl
etuon O;
int temp
atemp -M3
o -tenP
Output:
Enter tuo nunbers: IO 20
efore exchasge 'a is io and b is 20
Aftee erdw ge o i s 20 aud 'b is 10
An4int8) thad duakos3
.Lb). ustito a Ctt Junchisni pouweN Gint
iAbg.oosaLoued wastinllo
tus idoja JasAiablar.idoand s i dndi chtibsOn
aD AASumtast, Lompukod fa C i A O t ' i
4Ka alONKa JOSitble i14,.
he ionultb' in
aAAgciaod mainC) to caul PhiA unctirors
i
ulsito Hhe
#include <iost@eam>
USing namespace std
int. int &);
void powe Cint,
int main C)
int a . b , ges;
numbesrs:";
cout< " Enter tuo
cin >a »b;
Power Ca. b, ces);
<<" gaísed to " Rb<<" is" <Ves <<endl;
Cout a
oetuon O;
esult1;
for Cint i-i; i<-bs i++).
esult sesult * a
Out put:
numbets:2 3
Ente two
2 1aiRd to 9 is 8
LCe). ulstiter io tunction oocchanga Cint6, int, int8) hat uaoA
valueD
rstnca Jasuallan to ucisally aocchange
Centainac in HhoLg UJEBAiallaa
oito he aDAOciotod main to gro9CiAg hio untion.
#include <iostmeam>
vsing namespace stdi
void Cycliceocchange Cint.inta .int8;
int main C)
int a.b,C;
cOut << "Ente hdeee oumbers: ";
cin > a y b>C
Cout Before ecchange a ="{<a<<, b- i b < C={kc<<endl;
cyclic ecchange Ca.b. c);
a<e" b="<<b <<"C"C Kendl
Cout After eocchange a ="
oetunO;
int temp
temp n ;
n M
m O:
O temP;
Output:
Entev hsee numbegs: 12.3
befove ecchange a1 b-2 C
After ecchange a 2 b-9 C-1