You are on page 1of 25

1

Name Kajveer Sinqh


Rsl no ab51158
Branch CSE
Assignmun 3
#incude < stáio.h>

#includs <String.h>
stuut Data

Chay name |30


Lnt age
chay kity (2]

int main()

Ant n
pid b o peepl:)
Scanf ( /s ol" &n )
8tutt Oata a [n];
os (int i: o; i<n; it+)

printf (In Tk Detaiu js a


"td, itt);
ctchaC)
pint (Name")
Sean f (". \n] &a[i).namz);
pintf ("Age: ");
Scon +(-d 4 a[i]. age)
prirt t (" ccty:");
Stan+ ( [ ^ In] , & a[i].city);

Lht max e0

e (int i o; i<n; it+)


(a a[L], age
max )

max a[E]. age,

pint4("\n eldut't name: s , alj].namk);


pint f ("In Eldt's city "1. S°, alj1. cily )
utwn

No o peopte: 3
The Detail of a 1
Nomu: Raui
Aqe 31
city Hyduabad
The Detail ok a 2
Nam Abhay
Ag42
city Bihan
Detail a 3

Nama: Sbhin
Aqe32
city Deli

Eldut's Nama dbhay


Eldst's city: Biha
C

incude <stolio.h
Struct time

int hon
Ant min
chan sta LE1;

guct nain

Chan nam [2o)


Struct timu t;

ne mainl)

int n
int + (" Entv no. of tains: ");
Scan +( /hd án):
Struct troain a [n];
don (int i-0; ich ; i+
ok buain /d:In", Í+1);
puint f ( InÉntn yetails
Tan Namu: ");
n t +( n
gctcheur ();
Scan 47 C^\n]",main
unt +( HH
a[i].namt
time
Scant /. a", Ga [ij. t. h o u )
punt +" MM 0 ain tims: ")i
Scan4("a", Ga [J.t.min)
ind f ( Am| pm");
Stan .s ", 4a li]. t, sta );
3
dou (int i-o; ien ; í++)

4 (at).t sta lo) = 'A");

hnt+ln T tain /s i on lum: "ha: "# a trs


a [i) namu, a[i.L, hau, a [I.t. mud;
c
puird 4( In The tbain'l:s u m time: "hol:.el Hrs"
afi].name (a[i).L, hna +12), alt].t.
man)3
5

Qutpst
Ento No. o Tsains2
Entun Details of Train 1
Yain nam : Rajolhani tzpaus
HH O Train Aum 06
MM O Train tums 35

AM/PMAM
enti Details ok brain a:
THain Nam: Shataboli Expu
lume 10
HH e Tvain
MM o Train um 5 5
AM/PM: PM

he uain Rajdhani Exhus i on lim 6:35 us


n ume 20:55 tbs
Th a i n ghatabdi ecpeAs
include <Studio.h>
# inclucle <String.h>
Stuct stuck

Chax name [2o);


Ant usl no
Ant manks [51
Ant total
cha qadi ,

int main ()

nt n;
pint +"No. o Students: ");
Scan 4 (.d', &n);
Stxuct stuck s[n];
do ( int i- o,; ikn; i++)
puind("\n Details o stuourt 1- a\n " f+ );
getchan ();
púnt Namt: ");
Scont/:[A\n]", afj. namu );
untt Rstl No ");
Scant ea" s[i]. nsil no)
nt"Mauka og 5 &jects: In )
dor (ink je o; i< 5, jt+)

pidt ( Subj:7.a :" :_


marks l{];
Stant(7.a , & ali).
tstal + A l). manks [];
=

4[ii,
3
4(Alij,1stal 450o)
4[t).puadlsA

elu i4 s(j.tstal > 350)

[i.gade B
elu 4 (s (i].tstal e 250)
A[i3.ads =c '
e
4 (.grads
3 (

int i= O ;i<n ; i++)

Jon(ink i+1; jen ij+)


4 ( (3. tetal <A [j].tstal)
Struet &tud Lump = ül;

f1 timp

nunt +( In he soted lit in dwraing rdu Masdes


In
print +/s.Nb.\ tNama IE Rst no, lt etal mavlea lt space \n "):
0;i<n;itt)
o (Lnt i=
S|t 7a lt\d 7a lt 7 a ln",i+ A'7
\t
pint +(7 a. 7
6[i1.gtoels )
[i].tstal,
namu,[i].xttno,
3
9utuwen 0;

Output
Details ok Studnt 1
Nam: Rahul
Rsll no 416
Maxs o 5 Subjech
Subj 1: 1D
Subj 21
Suuhj33
Subi 03
Subj 5: 63

Detuils o Studint 2
Namt Ri ck
Rstl no: 55D
Mas o 5 Subjecbs
Sulbj 1:3
Subj a 65
Suby 3 84
Subj 5:3
Details of Student3
NamuGnautam
Masle o 5 Subject
Rsl no 511
Subj. 54
Subj 15
Subj:16
Sub 43
Subi: 8S
**** The souted ited of Sucants in dewuasing odle

total mas * * **
S.no Name Rsl no Tstal maes ouacde

1. autum 519 332 e


. Ric 50D Q43 D

3. Rahd D
46

(
1 includ (Stdlio.h>
# nc luds Sting.h>
Stuct olata

Ant day
Ant mm
Ant
3
Sbuct mple

Chan nam [2o];


Stuet olat deb
Struet lah daj;
antalay
3
vsid shno (Stúct a'mnlog, clil, int num)

Jo (int i-o ; i<num; i++)

inA Namu7s in , efi] .na m),


ind4(Dati of Bieth: "/.d 7-/'%an', e []. dob, day,
efij.deb. e[t).dsb.y"
puid f("Dati o jeining: . d l7.a[ra\n ",e[t 1.olaj, day
erij. da, man, efij. olaj ");
pijet +(" Salay ".aln",e li].Salay);
pind4(In ');
11

ant main ()

Ant n
nl+ ("no o empleya: ");
Stan 1-a", &n);
Struet employe e[n]1:
Jon(int i o; ien ; i+t)

pxintt( In dcdeils of emplrye "/»od \n ", it ) ;


pind +(" Namu: ");
gcteha ();
Atant
(^\n], [ij.namu );
e

Pintti n Oat of Bidh (Dos): \n ");


púnt+ ("Day");
beant( d &e (].lsb.olay
prindt ( Mputh No :)
Stan(
/od & et t].dsb.mon )
pint+("4yeas");
tan (d & e). olsb.
ipt)
utDay og Seining (DoT) : \n")
pint+ (n Day ");
cont (1
ha& efig dj.day );
pint( Mnth
No; /);
Seant( d", & efij da, man );
pnt (" zea; ") ;
&cant
(ral",&e [il. di. )
puit+"n&nlany ");
Sentd ',&e[),valavy );
wENSRWOWANSRRN
Ant chaice
ohil ()

uunt +("In ** with jan ehoite x x


*\n )"7,
nd " 1.Sout uy Namt In 9. Sosed luy DeB In 3. Sad luy Doj In
4Sovt kuy kelany In 0, mit ");

Tint(n In cheite ");


Scan +(. d" 2
i:

ehaire );
,

4 (choice !o
&4choite &5)
1width ( choite)

Case 1:
JoCnbi o; ien; i+)
n( int iai,j <n; j1*)
4 (Amp (e [ij. namt. elfl. nama) >o )
Struet amploy emnp
e[
e( elji;
e[il Imp,
3

pintf"In * *
Sout ***
ed ly Vomu
Shno e,n)i *
In In 7;
oruak
13

Cast
Jo (int i o; ien ,;i u)

Jo(int i.il;jen ;j+ )


(erii. cdeb.uyu > elj]. daeb . 4p1
1Atuck employu temp- elt]
L]el
lj trmp;
3
ee i (e li],dsh.pn e [f).dsl. yn
( e [i].deb, mm >e 1 .olob .men

sbuet
empoye tmp
e [tj. el;1;
[i);
eLi tomp
euu il (e [(t) olsh.morm =
elil dob mm)
(eti) dst.day) ely]. clsb.olay)
Struct emp loy tomp e
[£1
etje (f1
elji tum

13
14
Bisth: ***\n\n2|
By Dat of
untt( \n ***** Soveted
shno (e, n );

a
Cast 3
e(int i -o; ien ;i+4)

en (int i ist;jen; j++)


4 (etij. daj. yn ) e lj]. daj.47)
Struet emplay temp [il;
eftj el{1;

elu i4 (e [ii. da.yn =- elj]. daj.)


(etij.daj. mon > elj]. slj . man )

Struee emplzyu tump [ ) ;


etij[j1;
lij ttmp
3
cluu i (e
(t].dly. man = = e
lj]. dj. mm)
4 (etaj.dj.daycl.dqj.day)
Btuet emp leya ttmp = e [i]1
15

etj elj];
eli ttmp
3
3

pindt ("In ** ***SSeutecd lay Date ot jcning ** **


hin°);
show (e, n);
bal
Casu H
Jo (int i -o; ien;i++4)

4 (elt). salasy e [jl. osalaey)


stuce emplay. imp = t [ i ]

e fij e lj1
l ] mp

pint+(" n **** Sput ed By salay a** inln " ;

bhna (e,n) ;
huak,

clu i (chrite =o)r


16

**** \n");
pint+(In
****
xTED SUccE Ss FULLY
buak

eu

In ** *
gnualid choice
*4
\n ln ");
pundt
bua

utwn 00

No.
Oudpk
o Emplayae 2
Details of Employu
Nam Prabin kuma
Dab of Rieth
DoB) :
Day: 1
Mamth No:8
yea: 191
Dat of Tining (dos) :

Day: 9
Manth: 55
e a 1995

Sala 5 0DD
Details o Employue : 2

NaMu : Riaya borai

Dati og Binth (DoB):


Day :2
Month No 5
eah:111
Datu o
joining ( dos)
Day:8
Msnth1
ycaon:2019
Salary 250D
** Entv y n ehoice ***

1.SDttuy
3.
Name
Sot y DoB
3. Sovct
ly Da
4. Sot
uy, Salany
. Exit

Chaice: 1
******** Sot ed ly Namu * * ****

Nam:Pnabun kuma
Dafl of Bith: 14| 8| 1971
Dat e
oining: a|5 |1915
Salasy : 5ODD
Nami: Riya hoai
Datu ej Binth : 2 5 |1917
Datu et joining: 817 |301
Salauy 2560D
* Entur yon chsice * * *
. Sort y Nam
a. Sout
y DoB
3. Sowt
.
luy D
Sd ly Salau
6. Eu

Chsice:2
A**** * * * Soutecl uy Date of Biuth ******
Nam Babir kuman
Data o Biuth : 14 |s |197
Dat ol zoining:95|191s
S alaxy : 5000

Name: Riya Crovai


Datu o Bixthday: 3|5| 197
Datt af 4oining: 8|1 |301
Salay 3565d
** * Entu yau clhaiie ?**
1. Sot
uy Nam
, Sout uy DoB
3. Sp-t
ly Daj
. Soxd
ly Salay
. Exit
chsice:3
******
t** **
Soxded y Datt of poining**
Nam: Biabin kluma
Dat b Bith 17|8| 1971
Dab ef joining. 9|5| 1995
Salauy 500D
Namu: Rya bonal
Date of Binth 215 |1997
Det of joinin 8l1 \rol9
* * * * ***
*** * * ***
Souted ly obalouy
Nam: Pabin ktma
Da
o Binth 14|181 19
alt
eintg: |511195
Salay 5000
Nam: Riga Goai
Dat of Binth ? 215|947
Dats jeining:«|1 |2019
Salay : 150DD
X Entv yovi choire ** *x
. Soet luy Vamt
. Sevt
luy DoB
3. Soud
ly Doj
4. Spet
Ly Salary
Exit
Cheite e ******
7 * * *** * * * * EXITED SOccESsfVLLY ***
+includs ( Stelio.h>
5 struut Matrix

Ant 1,
ant mat [o][io];
3
Void input ( Struct Mabuin *)
Void shno (Struet Maix ;
void Computu (struct matrix, stuttmayin, struet mahix "

nt maun ()

8uct Matri m m m>


unt+(1n **
don ist matrix ** \n );
npuk m)
pint f( In ** fou 2no matrix * In");
Anpuk (& m,);
(m,.t! em,.A)
nt f ( Multiplicatuon mt pesibu")
el

Compude m, , m, m,); ,

Shso (ms)
3
utuwn
3
matrin* m)
Vond tnput ( stu ct

pint f{"No .o Rous ")i


&tan+(«d",&m-1);
unt +( no. ot coumns" );
Scani(%d", Lm- );
Pi " n Matrix elumunda : \n")
do (nt i:0; i<m n jl++)

do (int -0; f<m- C; j1+)

pntt"eemend
Stan
a[ d(7a]:, i.j )i
4( Yd, &m ->mad [] t{));

Void tomputbh (Atrutt maduin ml, struct m2, gtutt omadrix


ms

m3 ml L;
n 3-7 = m2.C;
fo int i- o; íem3
a;itt) (A

do (int f- O; <mi C;
j+4))
m mat (i JG] -0;
dox (nt k co;k<ml .(;k44)
m3-ma [T] (i]+ =m1 m a t J[L] m2.mad ]C/1

Void shoo (Atuct maisur m)


");
punt 4("]n lu mat rix atte multplitarion"
do (int i: 0; i<m ;ltt))

print 4 n ");
don (int i0; /cm:C J**)
printt (*a", m,mat [] CG] 7;i

*Fo dst Matrix


Wo. o Roo2
ND, of Coumn2
Matrix Element
tumend a [b] [o]: 2
Eament a [0][1] ;2
Elamunt a (11 ():2
elumant a (1][1]:2
* Fo Ind Matiz **
No. of Rao: 2
No. a Cotumn;2
93

Matux Elements3
tlemund a b] [o): 3
3
Elmunt a () C1j:
tlemen a C](o].3
Elmunt a t1 [) :3
hemalrix alt Mulipuitaton
12 12
12

#Lncud <Stdio .h>


int main ()

int a
(5o] (so)
Ant n
Pnd+(" Entvr oudvi og magit mabu'x (oded)");
Stan4(d', &n);
pin 4" In");
nte(n+1) |2,
on nk *:
l, n< =n ; nt4)
Jon (ink y ;9len;y4+)
a (] lyJ:0;
Ank i, y
do (i1 ;i<entn);it+)

a l) lel: i
ee
j+2
( = = n42)

4 (4 =n +1)
A=1
a Cji C 19:i;

e+
Ci--o)
n
4(=n+
A1;

int C
0 ke'an;
(unk X:l; n xHi4)
i4)
dor
don(in y l; 4<enjy+)

whiu (z7o)
Ct1

und f " d , al]l41;


25

punt d", a («]l,1);

print+(\n In ");
C O

uiurn0:

Oulput
Entr the idr og magit matrix (odd) 5
4 O1 0S 15

14 16
33 05 0

06 13 20 22

12 19 21 03

18 25 0a 01

You might also like