Professional Documents
Culture Documents
I) Lf Statmenh
Lenables the rogrommey +0 cho0Je o s of
insuthons, bofed on o ondihon. when the Condihon
evoluoted o u , a se of insruthons will be eietuRed
ond diffuet s of instrutons will be execwed whin the
Londhon Ps ovolugted t0 fo Ise. fulthth, it has 4 ypes.
o) Lf.- else
b)NOJted
)Else P Loddor
d) Simpl if or null else
e) Mull ele or hmpe elst
Swinh Satemen:
Chas o mulh-way Jelecbon t0tement Coled the
Swith stateme tha s easy to undustond te resee
ano 0ltenohve t0 i otem enk. The om mond sw'thes
behwun the blotAJ baJed on the expresnon volw. Eoch
lose label L
ShEr men} [s)
Shanmen)U)
defoul:
SPO men(S)
brak
2 w}) be e1ecuted if
Then exprsion
in Lorrec.
V) Goto S10nmen
GotO JHO omonHPs for jumpi ng twnho)
known
JtonmenH L 8 used 0 toonsjer the conol of the progom
Ps Used
om one blocn to anothey bloK.goto reyword
to declore the got6 Stohment.
abel nome;
n above Syna7, the g0t0 wil ponjjey the onol of
the o Yom to the tobel nome
0) For Lo0p:
Here, the Inifoligonon JHat menl execue d only
one hme ond af thut the ondinon f cheuled the
rosut o ondinonn fstu it will ezeuue the loop. t
fOlse, then for lo0) 15 U}mnotid. Howeves, th resui o4
CDndi non evoluo ion Ys duo, sONmend inside the bdy
body ofof
f0v lcop 9eH e7ed,9 the 01presonIS upoUed. whpn th
ondihon fobe, tht toop tumironp.
Do while loop:
Unlra whi l0 loop, the
body of the do i^the diffetunu
behweun while ond.while l0op P guoronned te be done
onu at a hmt
Synte
0 4
I) S-OemenH inidt the l0oD
while (bn dHon) ;
Wrin a progrum Hadd, mulbply tmO maiu Unn funton
ond without funChon .
Hinclude (Shdio. h)
VOid
musply (iat-moH{t2}{/2}, int met2f124fn3, intrirt,int);
Vofd odd (A
Void maun ()
int matlin(02), moj| {Vnjf2J;
Pnt i,j, k,m,
n.p;
pmniy("Entey tht number y TOWg (ols for S'mort\n)
SConf("7.d'hd,gm,gn)
pn[ "tntYr tht elements of the 1J1 muhiX \n");
fOr (i-0,i(m;itH)
tor [j-0:j(n:j t)
Sconf ("y.d", {matLfi1sj)),
int mut]f/nj,JumSn312);
WSHOrt mulhp)ying for two mohils
Or (-0,1m,i*+)
1
for (j-0j 4D,j*+)
Y
With Aunons
H include SHdio.h)
Void muh ply (int muHI12) S12] int mu 112]02), iMint,int):
Void add ( Ynt matLin) S12),int mal {i27f/2), ind,
VDid
VDid moun[) in.int)
int mu!in]tn],mw2Snn);
ind ij K, m,n.p;
Dvinif('oRr numbey of rows tol foy d mumy\n")
Sonf("y.d 7d", jm,sn),
p in " n e r the elemenH df tht ji möma \n'"
foi li-0,r m;itt) {f
for-0)jinij+t){
Swnf"1d", Smaj iSij)
pr' ny[ "EnRy the numtr dt tolumnj for nd moit \n");
SConf.d',faaLstt}% 4P)
prinf' tnRr the elemen of the 2nd mum1\p");
3for tf-0'%1¢n; f++)
forlj-0,j4pij++)
Swnft"7d", I mal?figj)%
Void muih ply [ Pni mui fn]fn], int ma 212]n), ind m,jnlm,i ndp)
1 int mul fn{n),ij.ti
for(-0, i(m; j+t)
for lj-0:jop:})
mli1i]0
for (0, K(n, K++)
for(]-0,<Pi+*j){
dumfi)ij) mtultSi3J]+mayz{i)tj];
'Uf[\n Jum of wo mghnus: \n");
for (10 i(m , +ti)
for (j-0 nj)
j<9;
1pintfny.d", umir])5
i (t-)
prinuf ("n\n");
3