0% found this document useful (0 votes)
13 views9 pages

Assignment No. 4

The document contains explanations of various C programming functions and concepts, including single character input, output functions, and array manipulations. It also includes sample code for creating arrays, calculating averages, and sorting numbers. Additionally, it discusses string handling and the differences between one-dimensional and two-dimensional arrays.

Uploaded by

rutujaap10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views9 pages

Assignment No. 4

The document contains explanations of various C programming functions and concepts, including single character input, output functions, and array manipulations. It also includes sample code for creating arrays, calculating averages, and sorting numbers. Additionally, it discusses string handling and the differences between one-dimensional and two-dimensional arrays.

Uploaded by

rutujaap10
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

PAGE

DATE: /

99iqnment 4
C CO Explain following tunchionu
ehchar ()
i s usedcuhen Single Chardcle inpd
sYeqw Yed o m he Ler
2putohay )_
I i s uSed to wrte a characte Of Go
unsonec chaYacle
3)ae qetch (J_
We USE this funchon o hald the outpud
Sereen tor Some time Unhl the _us
passes 0 keu om he keyboavd
which exists the screen
4putch )
iS uSed tor pmint chavactey
PAGE
DATE

C0.2 Design a proqramme: in C to'reaA he


n nunmbes_of JculueA in an gYay
display it in YeverSe Orde
E inelude <Stci0 h
Yoid main

int im alOD
prioft("input the numbe OF elemenisio
Ehe amayi \n" m)y - i
or ie Rem, itt)

Scanf ( dE",alil

print f he valiei oe \n'

pYintF ; d\E a i
p r i n t f " A n h e number s 0f aYYo in
TeveAe 0 y e \ n " )
foy i n i 1,--
printf (7.d\E a l l
PAGE
DATE: 1

CQ3 Explan 0ne idimenSiap HuD dimension


YYYs
One dinen Sion al airaylStores a sinqk
lisE 0 Vaxiou elemenb havinq a Similar
data hpe
u odimensional OYray Consists OYSans
Vayo aYYau 0Y a_humbex oF one
dimensionak auy
xplain_Slen áStYcpy hnhon
Cuh eyample-
StYlen O
TColcaleter Ehe lenqth Ot tghtn
stYing
ex.choY str 20 ="Happy
Printf "lenahh Of sAring Y:d" shven(
Outpu
enath 0t 9tYina
SEYcpu
TCopies the Stuinqino anoth.c Shing-
e -choY 3 1L3o= Sbinq
chor S 230 2Stina 2 m g onna
Copird neto S"
PAGE:
DATE: r

(05petl Explain_pou _2 ton.U functor


fa m nmath h he a d e tile cuith e

reluyns the pOuex otgiven Dumbe


,
-Theseaxe triqnametic func'on in
mcuh h file uhich talke angie in
sadian an aSnput i qeneYale
Ye Spechve Y SulS
Ex
include KStdioh2_
include Kmath:h>
oid main ) _

Float a 2 b : _ angle =oo 3 y2lFo_


printt( 2F\n'_pou Cab))
printf " Ean ( F is Yfangle tan
langle)
PAGE
DATE: I

N t e apyoqyo m tuiacept a Stying a


inpuutfyom uJen 8o ded erymine its
ength
#inelu de <stdio h>
int main )_

choya5
pyintf Ente 9tiing Ann"]:4
Cant "7. 9 a)
fr i:o, a [ i ] : '\6'++i)
pyintf n lenatni f input Shanq Y4

O1 WYik d pgram o a ddition ct tun


- 3 maite

inclu de <stolio h
int maìn ) _

inta331.bialls),c[3l3].j
pintf Enter elements toy matix A:\n
or 0, 1K3itt)_

Scanf "/d"_Ea([i]);
PAGE
DATE:
printf " enter element S of mahix 3:\n _
fa 0 x 3 , E).
For (05 j<3}t+)
Scanf( 2:d",& bi3Lj)-

fori0 3itt)_

cilli:a [il[;] +bi]

print f ( Flemenis of mabix C: \n

printf d\E", c[iJtil

print F ("\n")
YetuYn 0
PAGE
DATE: 1

Q8DiEfexence be 0 a y i Stiing

Axxau 9ting
A data stuchure 1 A onedimenSlonal
Consishinq of a Colledion aYray_ot choacBens
Ofelermenis e ach- terminad ed bu a null
idenhhed bu the charactey
aYYau Ind ex

Canhe one- dimensio-2 Aleuous two dimersi


n oaY huo dimens londA Ona

9Wrie a_pmqram m_accepr 0 num hem.


o gYTC 0Yrana thern In aAcending
OYde

include <Stc io h
int main )_
frer
intpI1o
int temp, D
printf " Ent er numbea of elements \n3
Scanf y.d en.
print Enle dnumber of elements Ipn
for( 0i<ns itt)
Scanf (/, d",&pCi])
PAGE
DATE: 1

foy Ci=0 isn-1itt)


kor ( +L<= D -1,tt.
A

if CpCil2pl}l
tCmp pil
plil: p[l
p i : tmp'

printf " SoYBed amasin )

pmintf ("7.d\n"_plil);
PAGE
DATE: 1

o Wate_ po qraho Ao acckpt ten DUmb


&pmint avera qe 0t it

induce stdoh>
intmain )
n t any Llo
nti
Hloa Sum OVg h");
priotf(Fnt e ID numbes

Y.d\n?'i£1J
printEEnter no
Scanf_2p &0YY)

Sum= Sum 4 aYY G

aa Sum_/10
print AveTage 7F»ava
Yenurn 0

You might also like