Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

DATE -pioneerpaperco.

com
PAGE No.

EXPT. NO.

Yucoion 6s

Wite a prDgaam fopelesm addihe, Substrachiem divison Qnd


mulhiplieaisu enteo ploahing_point numbea.

Algorithm
Step 1 Start
Shep 2 Kead wso numbeso a and b
Step 3 Additiem o atb
Step 4 Substractien to a-b
Step 5 Muliplieatieu ox b
Step 6 i f (b==o)
PeinE Addi tion
Print Subshroche
Priot Muliplicotie
Prin Divsom no possible..
else
Divis p 2 ob

Piint Additio
PICHEER Pmin Subsracho
Raint Multiplicaie
Pi'nt Divisonn
Step1: Stp
Sfar

Tnput o,b

a dd=a+b
Sub o -b
mul a x b

False
br:0

Tmue
dive alb
Pmint add
Peint Sub PAint a dd
Print mul Prin Sub
Priot Divician no Pint mul
possible PAin div

Fnd
DATE
pioneerpaperco.com
PAGE NO

EXPT. NO.

PaLogram
Dnelule <sholio., hz
iatmaimO
pintf Enter two numbero h 2
SCanf f ,f',ka,pb)
floo odd 2a+b
loot Sub a-b
float mnul-a b ;
i (b==0O
printf Addihieu 74\',add)
PhiattSubshrocHm , f \n", Sub)
printfMultiplicakhiom f \n"mul),
intfivise not fpsible");
eki
loat oliy 2 a/b
phintf("Addition , f\n"), addD
puintfLSulootan f \n Sub)
peuintfMultiplieation 4\n mul);
Pruintf"isim f",_odi),
PIOREERR

Preturm O
DATE
pioneerpaperco.com-
PAGE NO0.

EXPT. N0

Output

OEnten two num beo S


6
3

Addihiom: 9.b0 0000


Sulsbochsn: 3. 000008
Muliplicahiem 18.000000
Division2.00o00o
Cufnter two numbero
5

AdddHo: 5.000.00 O
Substrachem 5. 000000
Multiplicahiem O. bo00po
ivision_ not p0ssibla.

PIOHEER
DATE
-pioneerpaperco.com
PAGE No.

EXPT. NO.

WPu te a brD92am to ind whether he given numbez

Aleokithm

Step 1 Stat
Step & Read a number n
Step 3if(n/,2 = O)
PHunt n w ene
else
Peint n odd
Step 4: Stop

PIONEER
Stant

Tnpu n

n7.2--o Faslse

ue / Yhe num ber n


Odd

/The num ber n even

End
DATE
pioneerpaperco.com-
PAGE NO.

EXPT. NO.

Pogtam
#inelucde kstelio. hz
Lntman)2
intn
ptuintfEntez a numlsen \n")
Seang d',n),
n). 22c0)
PtintfJhe number d i euen n)

printf Jhe number oó_odd n);


Hehum 0

Output
Enten a numben 4
Jhe num ben 4 o eNe

PIONEER
DATE
pioneerpaperco.com
PAGE NO.

EXPT.NO.

Gusotip8

Weute aBrungRam to_delarmine uhethern a Rsxn eligibla t


VDfe

Algoruthm

Step 1 StanE
Step 2 Read age
Step 3 (age18)
Prunt The fuon eligcble to vote
ese
Pint 1he Benan à n6t ebsible to vbte
Step : Stop

PIONEER
Stan

Tnput ge

0ge 1 8 False

hue
/Peason o not
eligiba tovotz
/Fepson o
eligrble to vole

End
DATE
pioneerpaperco.comm-
PAGE NO.

EXPT. NO.

TLOGAam

#ineude <stelio,hz
t maim O
tntage
ptentf CEntor tte oge: \n");
Seanf C/d", uage)
age 18)
PAunt Pevon o ellgble to vot;
eke
printy Peyon tà noh
elisiblu to vate );
etwm 0

Output
Enter th 0ge.
19
Peason in eligible to vote

PIONEER
DATE
pioneerpaperco.com-
PAGE NO.

EXPT. NO.

Queotiom9

Pute a Bx09aam_to tof hefhon_a numben ó posihve,negahve


0n egual to 20D

Algotuthm
Step1Stot
Step &: Read the numlsen a
Step 3: H(a2o)
PeunEhe number posiive
eke i(a4 0)
PPint Re number nesahve
else
Prunt jhe number Z010
Step 4: `tbp

PIONCER
Sta

Tnput a

ao False

Saue a<o False

Yhe number a
posiive nue
/ She nurnbes 3eMo
/She number a
negaive

Fnd
DATE
pioneerpaperco.com
PAGE NO.

EXPT. NO.

PALDQaYm

#Includs <stdio hz
int mam Oi
inta
ptuintf Enla o number n

Seant "% d*, ua);


y (a zo)
ptintfC Se numler hd ó positive , a)
eler iy (a <o)
Printf Jhe number % ol o negchive a)
elae
Pintf ( Jhe numlse 2pr0 "n)

Output
0Ener a num ber

he number wposihve
Enten
PIONECR anumbeh
6
he numlbe 6 nogative
DATE
pioneerpeperco.com-
PAGE N0

EXPT. NO

Ques ti om 10

Weu te a pxogaam to enlm a number pom Lto omd


displayRe cosrenponding day the ueek using Sitch
saemant
Alg04uhm
Step 1: Stort
Step :

PICHECR
Stort

Tnput a

Switeh(a)

Yaue
Aue Print he weekday ó
Sundoj
falSe
Jaue
2 Print the weckday o
Monday
False
3 uePhint the eckday ó ueoday
False
Jhuein the wek day io Weclneo olay
false
ue
Pint the wee Kday vo
Thusday
False
ucint the we kdoy v fri doy
False
hue int Hhe wee kolay o Satwrday
Fal se
Tnvalid input!!! Enter a
Defaul number to 7
End
DATE
pioneerpaperco.com
PAGE NO

EXPT. N0.

ÍMgham2

include<stdio. hz
int mainO
int a
ptintf Enter a number
Seonf.d",%a)
Suwitel (a)
CaAr :
printf She weakdoy Sunday,
axaak-
CaAR
print he upeek dasy io Monday
bHRok
Cons 3
puint he weskolay leodoy
oxcak
Cooe 4
phintf Jhe weekolayo Wedunaoday
bheak'
Cose 5
PIONEER paint Jhe Weekdoy hwrsday
bteak
Case 6
pzinfl Jhe Weckolay o Eruiday
DATE

pioreerpaperco.com-
PAGENO.
EXPT. NO.

bPLeak

printf( Nhe weckolay v Saturdas


bHeak
dedault
printf (9nvalid Tnput !Enter a number Ito 7");
bPaak

Output
Enten a nunmben:
he weak olay o Monday

(UEnter a numberit
h e weckolouy Sahurday

(uEnter a number: l0
Tovalid Input nter a numbento
PIONEER

You might also like