0% found this document useful (0 votes)
8 views

Assignment 5

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)
8 views

Assignment 5

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/ 7

(| Wk a cpraam no nam

amn wning pini


#incud <stdio h>
# incdude stüng-h>
# dalre MAX Loo
# dulin NAME-LEN 5.
void sov Nams(cht hames [), int n)

char*tampi
tn (inrl=o, icn-l; )
forlinj-itl, jen,jtt)
4(amp (nama [i, nans )>o)

temp hams L);


nas = nams L;
name [) impi

int main ()

cha namesoag LMAxJ (NAME -LE );


chau nas (MAXD;
prin ("ena dh numbn nams:");
Scany ("7d", kr);

pin (entn 2d ram: \n', n);


t lint i=0;ien ,itt)
Aquk (nam Stoag i), NAME-LEN, stdin),
ramStoxage CO
(shenpn CnamStuag- (O. "\n)J=lo,
nam (i)= ram Stoag-(iJ;
SontNam lnans, n):
riny ("ln sotd nams \n"');
fa (iri=0, 4ni
itt)
pind (".s\n', nams(0);

Enan dha nunben


ram:3
Aie Sond nams
Vinotf Aia
Sarn. Chalie
Sam
Vinoth
#Incud <stelio h>
# ineud malh. h>

lony long fncial (int n)

f(int i-l; izunj itt)


fact =i;

deube comput sin (double x, int tm)


doube nine =o-0;

iny m 2* it L;
doubl pawn = pow (x, tum);
sgn* Powed factoial (inm);
sie=
Atunin

iN main )

daubl ang Aadia,


arg diges :");

Scany ("zd', atumn)


Aadian= ang* M_ PT /180. o;
daubu ur npu niu (aadiam, tum);
ang, ms, ult);

putput

Ent the nuunben of y in dhu s s : s

The aie of 30.00dgs wag


3 plain in dutail abet pam by va pam hy nee,
and Witi o Pgam to Swap tio nunbw
wirg
pam by vaue yy pam by f n .
Pas by valu:
Sn pam by vale, a copy of the
js panad to d actal pauanin
unction . Ay charga made to the
paramtn imide de funetion do not et the
Oiginal vaiabu.
#incuda <steis.h>
vaid modiyvalu int num)

pint ( Tmica modty valuu ;nun= 7d \n'; m),

unt main ()f


int a =5;
puint ("sefu calling moliy valuu : a: 7. &\n'; a),
noliy valu la),
puin ("Ata calliy modity valueia = 2d \n', ),
Atn o;

Be calliy modiy valu :as


Smide mody vale : num= ls
calli modily valu: a-s
Pam by aufne:
#ineud <stois. h>
veid modiyvalue (itnum)

printt ( Srmida molity vale :hum=7.d \n", un)


3
int main ()

puinlt ("Beou ealliny moduty val ia-


2d\n", a):
pu

modily valu (ka),


piny ("Apaa calliny modyvalu: a -7d \n", ) :

Bela calling modity valu :ar


Srnida mody vau: num=|5
atn callig modiy valus : a-ls
n pom by ana tha add d the actual puamuty is
pomd to dhu qunctim. The funtion can thun diiutly
modi<y he aigiral vaaiabls valuu ing this atuune.
Sungpngn No. wning pom by ahune
#indud < stdio. h>
vaid Sua (int a, ir * b)

ümp =*a;
*=*b;
*b= bmp;
3
int man )

int y)
punt (ienta tüo umbw:
Swap (& x, y;

etun o ;

output lo
Enu t umb 20.

Befo aapping: X=to, Y=20

Suwapping

You might also like