04 - C Example Programs
04 - C Example Programs
COMPLETE COURSE
PROGRAMMING IN C LANGUAGE
Part – 04 – C Example Programs
include<stdio.h>
#include Lconio.h>
Void main)
Scanf ('dari);
Printf (The Arsey Elemenk are \n)
forlizo; ien;)
Bintpc".dini, ace):
3
Output.
Enter Nun be af Any ElemenlalThe Azay Elesenk ane
5 21
Ertex Aray Elemeli
2!
Video Link - https://youtu.be/nt9V7G7RsEo
Scanp (".d"alJCi);
Pintf("d\t acici);
3
Pintf'\n
Outpuk
Enter Numbex R Rous and Ctumns
33
Entex Re Element Metia
35 44 8 9 3 27
The Given Matiz is
3 S
4 8
2 7
Video Link - https://youtu.be/JJo3NACrk_s
3 67
Matin Tnder,
2 4 o 2
A 2 4 B b 7 |2.
2 | 4 20 24 22
Borl/zoj j<n2j4tt)
Scang("d blJLi;
Borl Czo i<m1 ++)
Bocljo,nnyJtt)
elae
Print Mat Additin i net Pocsibe:
Output 1
Enter Num ber o Rou and Cunns kisk matóx
33 3
Enter Number o Row and Guns Second matin
3 3
Ente, Re elemendi Bil Matäa
36 2
2 L 4 s 82
Entex tRe elemeni Secmd MatiA
2 4 6 J9 3 4
The Re&ultant Addition Maton e
4
3
8
Output 2
Enter Num ber f Rous and Clumns inse Matin
3
Entes umber o Rous and Clunns Secod Main
2 2
Aatin Addii à not possi bte
Progam to Penßon Matrin Subction
Video Link - https://youtu.be/ud8KGeb_U6w
Dimension Rizt mathx
Dimensia Second matia
Condition Bur matin Subtectim m= m2 and ni n2
Resultant Matin Dimensin
bLoJCOJ
88 6 9 4
7S 4 B S4 2
CCoJ[oJ_ = alo[]
b[2]C2]
aleri] - b[eICII
#inclucdo < Stdio
#înclude <lonio.R
Void mainc)
Scanp ("y.d,laciscij);
elee
Pint( Matia Subhection à not Possi be")
getRco;
Output 1
Enter e number f Rouss and Glunns pist matax
33
er
EntesRe number f Roue and Clmos Secnd matix
33
Entey tRe elemento Bist matix
&6 9 7 S 4 4. 6 S
Enter tRe elemenh Second matix
648 44 2 S 3
The Resultant Subtacti Matin
2 2 1
2 2
4
Condition
n=P
Resultant MatH mX
Exampe
2 X3 X2
2 4 |3 S
A =6 3 S
2
3 t I2 t 4 27
3o + 2) +)o 41
c[iJL0J= cCJCiJ+ aliI[K] x b[Kci] 2X2
Second Matin Px
Resultanle Matia
Gndition
#include < stdio.Rz
#inlude <lonio.R
Veid mnàn )
Stan ("ydblicjJ}
ay
tr
le
Printf(td"n)
3
ele
Output1 ati
Rows and au Ask
Enter tRe Number et
2 3
Enter tRe Numbey RowS and Cimni e Second Matix
32
Enter Ae Elementa o frsk Mati
24 6 3S
Enter tRe Elenenli o Secmd Matix
3 S 2
3 3s689
- A
scending Orde
#includ <Coni.
Veid ain ()
s(alil< alil
temp = aCil;
arij = acj];
aLjJ :tempj
3
3
Pintfc"sdl ali);
Dutput
Enter Total Number d Elemena
5
Entor
836
tRe Armag Elemena
Ascanding Order ia
3S6
Video Link - https://youtu.be/doBfslY7tOQ
3
9 8 3 6 5
368S
9 8 q86S 3
b 3 S Desending Dxdes
#inelude <stdio. R
# include < Gonio. h
Void main ()
Scanf ("Ldace)
JP(ariJ<aci)
temp : arij;
ali]: alili
aLil z temp
3
Output
Enter Number Elemena
5
Enter tfe Arya Elemenlt
3 9
Desending Order is
q S 3
Pogram to Searel an Elemenk in Arrray
#include<stdio. R
g
ay
Void main) t
ler
clrserc
Pint(Ertey Total Number o Elemena ";
Ul al] == Seare)
foaund
break
else
Bound in tRe aragsaneh),
gelelo
Page
Output 1
Enter Total Number Elemea
lo
Enter Aray Aemenlk
2| 12 2203o3o 4|
4 66 &8 126
26S lo0
Enter tBe Element to Seave
30
3o u ound at positian 4
Output 2
Enter To-tel Numbe Elemeni
Enter Aya Elemenla
21 12 20 3o 4 b 8 25
Entey Re Eement to Seare
3
ma=
aLolj
C++)
iaciJ_ max)
max = ali]
3
Pintp("The Mazimun Elemeat in Re arm is Zd,mo
Outpuk
Enter Re Numbe lenenh in Aray
5
Enter23tRe 18Array 48Elemela
56
The Marimn Element in Re A
Video Link - https://youtu.be/MNKq2Z79V2s
har Damelool
int
int matRs;
ink phy
ink cke
int totl
Ploct avg
Veid main()
Outpuk
Enter Total numer o Studeaa The Stdent Detls are.