SOUGATA SOO_ME_22_Computer Language Lab Assignment 1
SOUGATA SOO_ME_22_Computer Language Lab Assignment 1
OWEle a
to paiut "Hello wlosl
progam
An
Einclude etolio.h
it MAn )
f (Hdlo Wovl");
heturn 0
Outu
Hello Woxld
2 ste a
prhgsam to 2wap oo intege humbex
Vasiable
As E ntude stdto.h
Hoat a,b;
prtf"Eter a:") ;
ennf "f, k)
eit Entebb:);
Can (%f,'kL);
a = a-b
atb
ab-a
I
Outpu
U dvariable;
umber: : 4
Entex Beconod wumwbex F
intyea
pidf( Enter a ye")
zcanf("zd",jea);
f(Yea 40o = = o
Output
a)shg hiv Va«lable
number: 2
Eter at
Enter eond umber: 6
nunmbex 6.00
Atx &uwappig kAt
=
vaiable:
Eh ude tEo. h
wt nan ()
P+ yea
p&ttf(Ent a yao to ckeck f 7+ % a leap yes
O wot )
2 Cn
(4 xya<)
yea4-= 0 * yeax 1o0!= o) ?
riClrYeAx
yeax2 A00-:0) ? p(Lap Yes:ist
Outpu
Etes a yea -to ekek 1f H a leap yeax oY not
2020
Leap Yeax
lse
prind d is no a
leap yeaN yeaY
Oudput
Etes a yea aoiS
2015 not a
leap yeas
Condet2onal Opesatod
Entade etato.1)
whle (nL=o
hemander=n %lD
eNeLeA = heNa e 10+Yemainder ;
-10
otiqina== eNexies
sed)
pihf ("2 4 ia a Polindrome oniynal)
ele
prdf"7d nof a palindNome. origial
hetuxn 0
uet put
Entex an nteged 230y0d4o 2
3%04 O04022 is a Paltndrone
PaY-2 M
st a, b,C, Liy
pitf Eter thvee bex:\n);
a d Z4 Zd,"a, «b, ke
b a b ? (a>e ? a:c): (b>c? L:c);
ptf C 4te Liagest aybe :Zd", biq)
hetuxn O;
Output:3
Entex th ree U beN
24
A8
48.
The bigest muhmbe
Wsle a m e driven progrcam uw hiok has
oUwing opt
a Fautovial mumber
. n e or ot
C. Odd even
exft
inelude &tdo.h
nlude conio.h)
nulude proces. h
int main()
p@tf(Fautorlol of %d 24am f)
break
| Cae 2: pvatf°Etey numbey")
Can d ' , kmn)
lor (it =2 iL= num/2 ; i++)
Coun 4
else
p r + f" 2 i ota prime unbey
en M
beak,
case 3 prêntf(Enter numbern")
.ean %.d", Km)
2 == o)
pretf ("2 ia wwwbex',um)
else
print f C% asodd ber, / uwn)Mm
bea
Case 4: pttf
(*Nthg to prit");
e+(1)
n ElexO to nt')
(fmp1)
Conttnae
elke if - - o )
beaki
Yetuy O
Output
CLeoke optton
1.Fauoxal nunbey
Pfmeot
3 Odd x eren
4. Exf+F
1
Entey wumbex
ia 120
Fattoval o
E t e s 1 t o qo bask te nman M enu
Choo se optisnL
L. Feteytal numbey
2. e o% not
. Odd er even
4.E
Notieyto prfat.
DAY
O 8f a kve dht
-
A
Enude 34olis.k
MaL ()
i t wum, a,b,c,d,e
Ktf(Eutex a Eve dtt www.bey:")
e wam % 10
/to)% to
C
Am /Loo) to
b ntoe)lo
a wn106co)
psft(%d a unotke dPBa of tte
num.bex d", atbte +dte,m)
Aetusn 0
Outpu
Etex a tive dalt wm bex 1 t 4 9
An
include tdo.h
nlole toneo. h>
fnelude att.)
nt a i C)
b9
hele (L!= o)
C a
hetuxn O
Outpu
Exter he value ot a :4
Ente ke value o,
4 holeto he powe 5 : 62S
beween i t o LDo.
Aw
inude (atdo.hn)
iman ()
fwt, a= i , tout
plle (aL= tsu)
CoLuMt O
L2
wif le (tL=aj1)
(aCai= o)
Countt+
bsea.k
u t =0 xk al =1)
at++
hettrnO
Outrut
13 2 2
2
31
3' S7I13
3t 41413 47 S
1S9 61 6
3 19 69 F
DAY
M
OWtte a potam to proalue. tollowig output
ho DAiRs given bye)>
) A D
A
A
qt( " )
he urn0
Out pui
Ete um bey of {ine
A
A
A
2
S
hude (4tdfo«h
E inilude Ktono h
int waun
pvint"Entos umbey of ne n")
pt f )
f t , t - (t» (C+09/2)+1; jki
t+t++)
hetuxn 0
Output 1
Aouble =1:0
ptf"Ente wanber i texmt n")
pCanf{, x*);
l = 1 ; iin; èt+)
fatf1
eY C-t 1 jk=t;jtt)
+ 107f
t
p t ( Theseayeve
hetusn o
Owtput
E t e wun, Lex otteym
S
The heqered um 2to8 333