Frograrnming languoge
——
a OO
level langu
— ce level lone
Mochinelang vage ot igual /@** 5 Tove»
Leo | ar longuoge Onaate , Visual basic
Objeateode Gouree Gade
Ly cpweardeareger APIA ONCET
Hreonslotor
—— u
Assembler Gompilee Inleepevier
O—a> gtaet / end
Flee @haet —> .
ao >
aw) jy
™ iS o> B peeession
won Gonvector
pato Mots / pieeation
mn aking8
(Gay
sort
ye
A= poea(se ye
GP = Resi
Cink)
sH Structure of @ peogeom
Consists of a Set of domment Ines aving the nome gf
X Doavmentation —» Gomments the program
v linking Seetion + header file —> Siero Sonetvoos
_ Provides inst nuelfons ithe Gomptiles to Vink fonel an eo
x Tifinttion section > define oll symbolie constonls| = sa
are di
X Global Dealacation oe .
vw main fonetion J ot
@lobal toaot
at
om man
funeotion 14
5
} TOC BTS
ra
Subpragoam Section
Fs
1
— 2
n
to
ee»#4 melode ¢ddiah> @onio.h
L, mad.
Prepe rocessor geopa
Boe.# include
Vaviable (Dota) .3 2 slat “artar STA eee
{tw
# Inelede 2¢tdioth>
f ™} ape;
peint £(" Enter the value of A,B”);
Seonf (* 7d yd”, Ba Bb);
9- Ab}
prin} $ C “sum = xd", 3)3
JKeycsovd cartes
keycord - @ longuage Wo anf Key:
ivat faeag cosh ava me
Vastoble
——. __|
in ! ” aift
cb Peimacy @ pevived @ vse difine
/ Build invariable
Types of variable & + address csovd
b Ghavaater variable CBee.)
Dealavation Syrrlox t
w integer
Dolo. ype. dato ay
cd tloading namet to be
coud
Qhap -eee 5 5 °/.€
integer a
int a vd
$loai > A?dype q
Deo tyr Memosy Size
Guilt tn
1 yte
-> Ghar + 70 >
@ @haraeler
2 tayle
& = adeors
@ integer - ini + 4d >
operator
@ floating » float » nf > dbyte
@® Pouble +
#4 InGlude
Noid maint)
f Int a b,x;
Pent f ("Entep the value a ”)>
seont ( © pd Ra);
Peint (" Eytee the value &”);
seanf (" 4d.” 2b)”
%= Atb}
peial fC“ sum = hd EH)
J
i¥ Vaciable Meclaralion Rule
@ Reserved keyasord Not allocsed. poe
tnt @haw x pos (Base , 2ces<'s)
dy int @a% Gox Poes Coes)
yw 3S
th $ 12>% 4X oc (*,-¥)
1) No space
atjbxSSO OTS,
Operand j opecatoe & Expeersion
oe
opavator
abla} Expression
Operant
Bpee of opecator @
Binowy
i
@ Ath metical operoton’—| , uniaey Fhe >
@ Relattonal opecoton
© Logieal opevatoo ;
+e R= REI
® Aeignment Pee tag ri ment
@ Conditional UO ete =e
5 / Ho- 2 eet
Brtesice Post ingeiment | post eagle,
) @epeciat
Aivalode 2$tdio.la>
fin XS ;
Maeskt+
ttn;
point £ (“ Rogalt =.” ») 5 | Print (“Result =rcl sey)
}@ relotional
HAS
o> a
ws a
> >=
@2 a
1 @4 > £=
}
OF >
moin()
{int wu y,2;
pemt (“Enter He value », 4”);
sont (xd 7d, wx %4)5
Z=*OYs
point £ ("2 2 7d”
}
(3) Logica 1 Qpecatow :
A hind qete
i. - _ wu fee}?
WAND > X = P
D | epecsent
CDOR o> + =p @- aeB Lt Jo 00 gate w pearen
ui) NOT > inverse py aa
Vaid maint )
fink %=5,4-10,%--1
Ps
Pe crcyb& (x >2)
point f(“P- 7.4”, pd:Voidrnain’ )
fint x20;
peint$ coe
@ Assignment qrecotoe
G Gondilisna!
Sy tox
opervedoe =
H40 GAH OD Bit SUH
EXPI19 Exp 0s Ex -3 7
f int we reer]
Geng)? ay pelt $(r¢ ~ sds size a6 (0);
Cont wl
Slatment -5 vw estthout 14 Poogear Gomplete “imposatble, |
|
:Pe A+B
cs 1
d
fl -le lel
|
\
es al o |
« ° =
IPE
Ww
AtP
otoControl statement
wb Branching
fib Loopy
rere wo if
aes ae Beanching (o) else
for — @ashile @ do-cahtle eee
: @& Sarita
© Continue
© go to -level
if
&
syntax '$
if @ondition)
= oid moin C ).
= Statements
f int ab3
wy Sean$ (Sra ste8' 202)
Flo«@havt Wiode)
pein S(* Bis @&
a a
‘mt 0, 6,243
seonf (“nd 7-09 “pd?
ga. Kb ACR)
18 (CacQuale >4))AER
am» if -else
Syntent
4S Ceonditiow )
y7
=
Void main( )
{ ‘mt asb;
a seount (7.4 sd q £.0,b)
1£ (a> b)
print § (Ais Gthen B? )
-else *
pemts (Bis Gother & Hon a)wid mainc y
{ int a, bee ;
goanf (zd ud » &a, kb)
ig Carb)
paints" @~ por (a,b); e .
ee peintS (the eesult is = 143 eciatadd> .
else
point $C the posult is =/P» 2%? >
x0
ae
i
void maing) a
fint a,f.e;
seant (fend ud 2d? &a.%lo,Xe)
f (Cofl>b) 22 Caxad}(b>2))
® ppinaS (% the big numbew- Ad 2%
else if (oa Bk b>) iS (arb)
‘ : J
Pind $ ("the laoger \, (a>@)
numben =7.47,
: P-A —T
else ep -@
. Ce
point $ (“the lowegen ee 39 Co >@)
nu mbe Pp we a.c) «
p-b-
Pe -
na RE
nerVoid maint)
tint a, bes
oo
» go Ke ges
seanf (Mt yd Ld ed»
if Carb) :
: ST OLe
if (ase) Perna eds
point £ (“the loeger number |S =
ee e)
ge Oe
else
peint f (“ The Jaeger number !
else |
if Cb>@)
umbee
Pvint F (' The lawger Ba)
a’3 e) 5
ie wn w)>
else
Point $ (The loge numb}
Yfoelse if -else
f if (@ordition -L)
else 1f ( condition - 2)
else if (condi tton-3)
elsevoid main( )
Yoel@ondrion=1)
f int asb,e,d,e; ae
» Lo Gp, UO RASE?»
$C nd nana nad
is eae yd) rEtor®))
18 kaso reXdrai(Cays)22(B>e) & 2
peint$ (aL) lacgen numbers is 2 4d ®) 3)
else 1F CC s0)22 (bye) K&L BDA) 2% Clo>
peind sf (“ The lawsges number ig oop A)
>2))
elseif (Cara)ee (ey by &u(@rd *€CNoid maint )
6f &
if€ tnt dge 5
w seant (4d 4 kage);
if Cage £=0)
y pein F (“ Not Born 7) 5
& ws
else If Cage < =12) @ ¢= age & age
print £ (« @hi ye =. —_
y else i¢ Cogs Z= 19) “= =
peint F («6 een’): a2
else fF Cage 2 = 29)gesiteh (@ond)
fease Value _; .
= Statement
break 5
@ase value -2:
== Statement
| break 5
1
Gose Value +s
beeak }
defoul} :
=- Statement
Void main C)
1 int inawk sgoode;
points ( E. y Monk “y
sean$ (“4d re moe) 5
wmoek grade = Mak 7, 10 >
Ses ite Cacode )
Qose 16° 5
print $(" AM) 3
@os@ biceav 5
@ase 9:
eps Ar
pecat 5
@ase B+
=?
lbveak;
@ose 7:
PO A
beeak
Case Ga in@lude < gdio.h>
¥# Mmelude math. h>
void main()
{ float a,b,@,3, avcea;
peint £ ( Enter the aem of teongle A=
sean (“Ff 274% Ro. Kb XA);
if CCarb)>@) &A((o+2)>0) & & (era) >)
\n B=\P@= 5
f S=(Atbr+@)/o 5
oven ~ sqct(s® (s-o)#(s- x82)
pemt £ (“the Aveo. of the Aniongle =
3
else
print f (“ Not trangle »)s
}
apf 7 0880);pte 40e
% inetude
+# inetade.c moth.la>
Noid maint)
{ float 0,6,0, 1, %23
print f (“Entow the dhteem of x2 = > 3
Seonf (“x 9? ga) 5
\Y point £(¢ Enter the Heem oft= ae
Scanf$(*y 7 kb); ;
point f (Baten the teom of constant = ">
scan? (*%F > Ra);
22 = (~b + sqet (008 (6,2) axoxe (ono) 5
204 = (—b~ sawt (Poe (b,2) ~ IRA) / C282) 5
point f (“Bme value of x2 =%F '} x2)
print ( the value of x1 =e F ” oe)
Jve
yee 10
ys 20
1 %e
x= 20
yet
wold motes ( )
| print PCS se =
rd int xy;
point $ ( oe= ye”
ae C* td", Box)
Pont FC ge 72)
Sean (teydy £4) ae 10 3229
Pett ile ob dL yoy t=
Ce ap w=
. get
pone
ew, Za 4%
point f (out put ard wr);
peind ("out put Yared > 45
3looping
je
rd J
fow nile do-cabile
* foe Ciniotializolion 5 Aa mpore
@ Z
S
1 boedy ‘of the loop
J
Void main (>
{2 Somd sy
12} Som, '>
ov (deny 142155 int
sum. sumet
j
poird? (sumn= 13”, sum);
incre
%
srveve)15-1S+ die 00 fe} tials,
void matin C)
tint SuM=0 > OO 65
‘ 2
foe CM =15 5 YD 42=I yen-2)
sum = Sum + apn >
3
points 64 Sumekd ? sum )5
S4 lor * aNe?
void mato C)
{ ing i, a, Sum=06, rp >
point $ (“ EaInpot the value oS Y= aes
Ge g 5
Sean$ (%* ad > gn)
i oer Wt RAY *
fow Cis 53 ¥ Bigen }. isitsg, 5
7 Sum = Sone l :
MW=aX+ Ot
Point § (* Sum
peind $
fd” Sum) 32 gt 2 4
Sri? ot Ne O
Void main ( )
2
{ int ni, sum=s0,C28-
oof =
oe 10 OF
+g poindS (“Enter the vole
secant (nd 72 0)
j.i+5)
Sor (i: fines 6,2) , en?
Ge
gum= Sum + poe (182) |
@=@C1135
, ;
pring £ (ee sum = wd) sum )
Cte ot 3% 44,
Void rrain C)
f int yt, Sum=0 , @=1 eK 5
Poind $C Enthe 1 = »)
seanf CSp~d 2x »)
foo Ciza ,tgoeen 5 feted)
Suyn = Sum 4+ pas( ise )
@s@rl $
i
#6 xX. Pos (Summ, 19) }
0 nd $ (as Sum 3 “Zed: 5
Semvaid main’ )
find n, i, sum=o
point $ (Ente n= 7
sean C% yd, &P )
foo C iets bg Gb
J
Sum = Sum+ J
oP)
1. te 2LCd)d+ Qe Orr
void nai ()
Da
f int $, 0, Beam b 19,5 B >
mm seans (020%)
Joo Casi, agen 3 a-ar2);
fear. extra”
add number apa, —
pymis CThe &
ce,
for (a=1; AZ=N 3 azar+2))
f point S 6 ne iasldanumbeiow ‘t.”, 9 0)
iSloet >
aote er e=O
G 7 >
fe
[ 1 b,0
MAIS Sar}
devs tpul a, be
o: potend 30 «(- b}e sqyet ({pocs(eb,2) ~1# 2X2)
Slant
Step: 2: input a,b e@
slep 3: D=B- 400
sdepd: if CD>=O)
Yb +ID
ey cas "IP fro
peint £ Key
© xr. Cb- [oy
2a ye
Peint $x,
Step '5: ese
poind$ + Tmoginan y
Step!6! Evel
hiner:“tpialf2ad von
cahile Coorddition) eo ;
/ Pom + sum +a
= a
art .
incre ment /Decre mend
pons # (ed aaa~ad
: rs te
qsient 05 B)
ita oO CG
ter ey Me
X= 65 5 /
Jas. (ca 6-88) “ per GL > te
D pwint # (ead) _
eee Rt,
}—
— , . ip | Vi)
= body S
Sma Gg
in/ be ot
I Ny
ahile Ceondition) ; ,
;
Void ynain €)
f Int wS
265 5 ‘
do . pend
i point § Gsst \ oe)
mee
. >
cahile Cax =A && xetz’)Soo Caso; 1295 int)
} foo (4-0 > qerdsder)
point F iG * De
J peint $ (a \n Ds
gcteh C) 5
te
eva
Void main C )
Pint B,43— Ree
7
456F
4 O/ Ly sess itice SOG TH
ff
re) le F654
fint
wbile (n}=2)
% =n 10
point Cred *)
n= f10
-1-2-3-4-82@ eX a
#
te
void moni C)
f int n, Sum=0 5
point $C ne”? ) 5
Seon$ (xa En):
Ww Kept
foe (Bret 5 @zeeN 5 Q-n-=)
{ Sums Sum4 %—;
? .
pemt £ (sum = -%d, sum),Ajores ~ @onmect fora
Types
One Dimension
I
Data type aveay Name [size]
@hoe o[s]5
diTeso Dimenssion
Data iype avray fame [Rao') [clown]
Pecgeam 7
One Dimension °
Void main()
{ int x C16} > 2
foe (i=0 3 62 18 viv)
seant (“zd &xLi] )
of Similae data iy, |
io 4 4
in alioo] > reat,
Date &
onica,*
*
Nt silk aa
void main()
Etnetel a3
for (i-0 5025; dtr)
{seant (“za @ xCe]e);
peint $ (“Qui pul of Aeeay’);
Fow (d=; az5 sare)
point $C wp xed] = 7d, 4, 24D);
}
void main
fin «{s] ,4 ,sum-03
Soo (f203;525 54+)
{scans (* ra”, & XL] );
$oo (8203 $25,444)
f sum = gum +e]
point $ (“sum = 7 Burn) 3
}c
oe ccens, (7a 22h)
Soo (4-05 425 5 der)
1 5 (to zxis3 )
la = xfs
4
peiol f (the longer number = p t
¥ prime numben
Loo (4+ 2;32n para)
{foe (4-2, 4e=4> dtr)
if (4%4 = =0)
break .
S
iS (i= =4)
Len print wood 1 @)# include Csidio.h> 1.21 2BAt -
void main( )
Ind n.d,Sum=0 5 a
| point? (8 Enter we volue of 1 5
| saonf (*fa”, 2N)5
foo (ter jdeen; Set)
° o
| 1 gum (som + iqieaera}teriacs} (oxen DRG +2) ) > «
| :
5
| i
peint $( Sum= "ed ” sum )5
{-
# include |
| void man ( ) 1.95.03 + 835.95F
dint 9, 8, sum=03
preind $ (%* Bat N 2),
Sean § (~~, gn)
Sow (3-15 S22) whee be+2)
{ Sum= (sum + baie) e(braebrs)
3
pring $ (*: som “hd sim)
Zfoo (des$ 3-155 e-N 5 S44)
{ sum = Sums (ira) (515) #046)
(
lates ees
foo ( g-01; §2=5 a+r)
} for (4+ 5 ejected sate)
peinif (* @zd"4 )
print F (% \a ”)
yp) |
Qpoce TsO
Gray fd
ww a
Led | 2afiot 43
Soo Cian Oe 3 b++)
f tow f(jetpaaog o-859 04)
point $ Eon eah (“720A a);
peint £ ee ga? ae
pe i,4bo03
Soo (darjiesn i dre)
{for C4215 gerd Att)
print $(« pad”, 3), |
peind £ (
are?
arig z=]
Piefrevoy _
‘Tex0- Dimenssion
prey esp col
Deda iype © aeray
} intote] 2)
void maint)
f int 4,4 0B) PI
foo ($-05 s2gsst4)
} for (4-035 44? ? itt)
Sean $ Ee ya? ,& als) tal )>
point £ (% \o )
J+4}
4
void main( ) a
Tint § 3,4, aCe.) ;
for ($-0; 823,544)
Poe ( 4.03 420 art)
Beonf (yd 2 als] L4])3
} >>
Print £ ( Output of the ABPaY )
for ($-0 5 623, a+b)
J foo (4-03 422 5 4+F)
ad ok.
print $ (“100 wh vad % vols] Lal);
point £ C"6\n ee
ounvoid maint )
tn a, go l2] 1215 ates AY DD
f point 3 (Ménioe value of Maivie?
Sow (i <0, 3422 84%
{ foe (4-03 4e2satr)
seon$ (7472 & oltlls1)2
j Ee
void main (>
> soy cal:
§ int ig, alta, praatele ,oCai.Ced >
point $ (‘ Molvix A = Up)
foe (s-0; §2 2,444)
fSoe (4205422540)
sean$ (« na”, & aCHA1)>
Moivix, 6 = »)
} ;
point (“ Qabpok oe teeaadoln A
Goo (b20 5522584")
{ gor (4205 442 part)
gp aots3 La) 5
seond (% 4d”,Nita
peint § (sum of dhe Moteix )
for (S205 522 oi i+)
I 00 (4-0 34e2s4er)
CLA Pom - ately) + & ote] LAD
petokeg 2 print $ (" 44” etsilal);
peint $ CfA) 5
J
2
4
3%
_S&
2x28 DHL