You are on page 1of 8

SubComputer rogramm|ng LanguageI |ab

3
rd
Semester(Summer11)
/*WrlLe a program ln c Lo deLermlne Lhe area of Lhe clrcle*/
#lncludesLdloh
#lncludeconloh
#deflne 1 31413
vold maln( )

floaL arearadlous
prlnLf(LnLer radlous of Lhe clrcle")
scanf(d"radlous)
area1*(radlous*radlous)
prlnLf(1he area of a clrclef"area)
geLch()

/*WrlLe a program ln c Lo deLermlne Lhe power of Lhe Lwo numbers*/
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL xy
long lnL z
prlnLf(LnLer Lhe value of x")
scanf(d"x)
prlnLf(LnLer Lhe value of y")
scanf(d"y)
zpow(xy)
prlnLf(d"z)
geLch()


/*WrlLe a program ln c Lo deLermlne Lhe largesL value of Lhe Lhree numbers*/
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL A8C
prlnLf(LnLer Lhree valuesn")
scanf(ddd"A8C)
prlnLf(n1he LargesL value ls")
lf(A8)

lf(AC)
prlnLf(dn"A)
else
prlnLf(dn" C)

else

lf(C8)
prlnLf(dn"C)
else
prlnLf(dn"8)
geLch()



$& G|ven 10 va|ues and f|nd the
b|ggest va|ue of them&$

#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL lblg32000n
for(l1l10l++)

scanf(dn)
lf(blgn)
blgn

prlnLf(1he blggesL values dblg)
geLch()

$&G|ven 10 va|ues and f|nd the sma||est va|ue of them &$

#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL lsmall32000n
for(l1l10l++)

scanf(dn)
lf(smalln)
smalln

prlnLf(1he smallesL values dsmall)
geLch()


$& G|ven 10 va|ues of x f|nd the mean&$

#lncludesLdloh
#lncludeconloh
vold maln()

lnL lsum0n
floaL av
clrscr()
for(l1l10l++)

scanf(dn)
sumsum+n

av(floaL)sum/10
prlnLf(fav)
geLch()

$&Jr|te a program |n c to pr|nt your name&$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
prlnLf(8ahlm")
geLch()

$&Jr|te a program |n c to ca|cu|ate the number 0 to 9&$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
for(l0l10l++)
prlnLf(d"l)
geLch()

$&Jr|te a program |n c to ca|cu|ate the sum of the fo||ow|ng ser|es
1+2+3+4+S+6++N &$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL lsum0
for(l1l10l++)

sumsum+l

prlnLf(d"sum)
geLch()





$&Jr|te a program |n c to ca|cu|ate the sum of the fo||ow|ng ser|es
1+3+S+7+9+11++N &$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL lsum0
for(l1l10ll+2)

sumsum+l

prlnLf(d"sum)
geLch()

$&Jr|te a program |n c to ca|cu|ate the sum of the fo||ow|ng ser|es
2+4+6+8+10+12++N &$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
lnL lsum0
for(l2l10ll+2)

sumsum+l



prlnLf(d"sum)
geLch()


$&Jr|te a program |n c to read a str|ng and f|nd the |ength of the str|ng&$
#lncludesLdloh
#lncludeconloh
vold maln()

clrscr()
char name34
lnL n
prlnLf(LnLer your name")
scanf(s" name)
nsLrlen(name)
prlnLf(d"n)
geLch()

You might also like