Onit-4 9 -— C79 9
gy ribat ovethe vorious Chametertstis of the
Algoxithny .
An Algosilhny ts q well defined Set of Insbuetions
4o Solve ® porttcalay problern,
Tk is a Pweeise Step by Step plan ty a
Computational Proteduve thot begin with an init
value and yeflds an output ina Rette numbed
of Steps:
FTL Ig written iy English, not th fore Jang uae
AT must be cleod, precise < unombi gous.
Properties of ALqoaithre =
® Finite ness
» Delonte ness
* > Treat
* Output
+) Flestive ness -
Re
nikeness + ay, alapritirs terminates ofter a
Finite numbeg of Skeps-
Dekene . 7
Rite hess > each Step 'P an al gozithro is
Unambiguous. This meant that the atttoy Speetfied
Scanned with CamScannerby Ahe SAcp Cannot be Inteupreted 4n Poultiple
teays & Can he pesfurened yoith out ony Conf ston
Thput 3 An algorithis Aceepls Zev OD boxe Inpats
Sukpt It provides alte atleast one output -
Hedtiveness Tt Constst of bast ¢ Snshucttons that
are
Bealigzable. This Meoing thal the Inchucttons
Gan be performed by ustag the given Tnput ra
Finite Amount & time.
Algentihis -—
Larite an algeriths to Add shoo num bers
entered by the User.
Step 4 + Sravt
Step 22 NeClawe vagiables hutn 4 Maya
Step 32~ Reve values hurt and puma
Steput— Add numt and nur and assign
Sur nym t tna.
Step 5% Dt splouy Sur
Step 6 Stop.
‘Scanned with CamScannerOehine Roo chant . Explain voaious Prous Chart,
symbols. Explatr wrth one Rranple.
Flow choot = This a pictorial wepacsentation of an
Algoatthra » This helpfat fea belt
writing programs ond Sxplaiinhy the
Pr Fram 5 to others:
Symbols af Used I Fig.g chart i—
¥D Co) A Stavt [stop
oval
a 7] —> Input | oudput’
Poralleleysasy
3 Oo > Pre cessing box C compilation)
“secharqulay box
vi
* Dectsion box | Condiong) box
4)
No
5» 3 Comes the Symbo| of the Flow chast +
& O > Connector
ZS hr loos I
Used fer Sub-reelines
Scanned with CamScannerfai check tweathies given numbes PS even[ od
Gay Alhat t9 pserwlo Codie? Alvite A Sample pseudo
Coole.’
PSeude Code 15 an Forfa | way
of Writing
Program d
for betters human “nderstoneting. Te 1,
vlorithen in S$
Tm ple Englzsh , moiking the
Comp) )
™PIX Progaans easies to Undesstand’,
Pp
Surdo(ode Gun ol be Compiled ox inlerpre bed
4
TL dees not Ftow Syntax ,
‘Scanned with CamScannereq lalate PSeuclo code 40 Find sumaf Mbwrod hy
Stovt P®Gvam
Declare VorTables N, SUm=6 and 7
Gnter the humbes for n
Fa iat to Teen
Porters Operation Sum= Sum +i
Increment? Value by One
Paint Surs
fn d Program.
Qu Explain, th, Shucturve of C ry.
Prepeocessoy Dire chive
Global De clavationy
tt maine J
t
Local Declarations
Statement clee laxations
Scanned with CamscannetQsy Explain dyprcal eps tor Entering ,Compitag
Omd executing “C' proyrams.
The Procedure fow translanting eer
LHe fy C Inte machine language 95
Phe ‘eliovoing Steps
MA Waking @ Sdéiing the Progam
Fay Compiling the Progoam
*3) Hoking the Prey rar with *equized modules.
*us reciting thy Prpicin
ing edt ing Source Progzara
_ : Flenarn ec
Compi ihey
Ll 4#— ject Code
link ew Fh morn € 08)
J + Sxeuctahle ende
Ta ceuton Filename -exe.
(py)
Scanned with CamScannerWetting % a {ng Pro gaary
Phe Software used td wre Programs
& text tlt
2
'S Know, os
HDA text Uittox helpus enter, chong @ and Store
choverted dota
-6) Onte we write the Progaam Tn the text cd Fors
we Save iy using aFlename Stored with an
extension of .¢.
+ This file fs weltered ag Sousce code fle.
Compiling Programs
The Code Ts an Source file Stored on the disk
must be translated tte machine longuege. This
15 the Job of the Compiler:
~The Compile” ts a computed pegrars that trons-
- lates the Source Code writtn: In a high eve}
lanyrage “Tbe the Corresponding object code of
the low level language. This translation process 7s
Galea Compilatfor.
*S The entire high level Prgram'’s Converted fnto
the executable maclfne code fle,
Scanned with CamScannerLinte
nhing Programsi-
The lrkex assembles all functions the programs
Functions ind Synd - Systern’s functions Fntp one
Oe cUkabe Pregyam.
Crecating Programss— a
> To execute a Prgrarn woe USE. OD Opera: ig
Systqen ” Command, Suth as mn, to load the
Pregzars Into Primacy Memeay amd execute tt
> Getteng the Program Trt MErn ory is the fine.
—Hion of an ORE Ating Systety Progrars Known
a5 iy loader
>It locate the ex eenkable Program and reads
14 Fethy Memory
> When everything 15 loaded the progam bakes
Cont) and i+ begins execution .
‘Scanned with CamScanneroo ———
8@ What a%2 Various data types im C and
explain then,
Data typess— Dota, type Specify what type of data,
Should be Give, bo the Vartable.
cass cotton of Data ty pet
“a
Oser defined
Pinang Devived (derived
© pardéfinel Frm per)
int Arrays nea
Float Pointeas Sree
Chay lurctions : ~ Suche
Void —=
mere Beta hype
= Trteger Dortaty pe fy
ittege Values ,ov-to Stre
*holenunbers we use “mnt
as
Signed Unsigned
int (2 by tes) int (2 byrer]
> Short int C1 byte]
Short int Li by te}
* tong int Ly byte]
5 long ‘nt Cabyte)
ternal Specie forint is 73"
Scanned with CamScannernews -
Iran pops Used to Shwe weal Pum
Float (ubyte))
double Co bytes)
long double Cio bytes)
hor ccteyL always pare 2 nil
TL liged ty store chometer values.
L Signed ()
{UNS igned ()
& Empty Space
iy
Void
> lente 4 deta! Abouk Standoal Ibex Thput/
Out put functions.
Te Sidioh heaoles f1¢ allows 48+ perf
‘Japurt and output Operations
ine,
The functions like Scan?) nd pate FU owe
USed 4p “epay
output and take ‘input om
Used "spectively
‘Scanned with CamScannerScant (S% " & Yslipregyam ty Tecleve the
Tnpuls from Uae Key Board,
+The Scan? Auction, Teads -foomated “input from
the Standard Tnput device kexs boorsd »
Syntax i SCAM" fanat Spectre") LVoseable nome) ;
point dl) > Tsq Standerd out pet Linctton whith Ts
Used to print famated Shing $
PAU " Forero speiifrer’, Omg urreest ltst)-
Q@gsklhot is an operater’! €xplain di FPesent Operat -
99°F ons available i CT Srplal with gutteble
Sxample-
Sir Opercdtoris a Symbol that tells the Compiley to
Performs Specztic mathematical , Conditional ca bogi af
Functions. Th ts Syrabol thal opesata on a value
Or a Variable
Vinory toperand Ge, --)
Operoctons Binasy 2 Operand
Temmny 3 operand
‘Scanned with CamScannerPinon Opeutas
"+ Pethemotte Operechns
2. Releattonal Opera? 5
3. Logi cof opecatos
Ue Bit -wise Operndors
5. SH Opegatoas.
2 8 ASsignrrect Operators.
1 BrtBemactic Opeaarhors
/—-> Drision
tall | L be rwhp OF ive
Wb =) epee ive
ab
GE Tot oy og,
[ Othe §
Ind Sur
Sur = O+h ;
= 30
”
Scanned with CamScannerao Releational Operate: a std of Melt to
7 erforn HAS k
p < < f
, rs 9 ‘
| L Unwed equalte
equalto
; ‘set | hon eval
Sareato than oe
Sect nme ena °F
tid Legal Operates: tale have three major logedas
Opesatms fn Cc
F Logral Not (1)
* Logical on (1)
* Logit Brun (£8)
Gr Logical Not C!) &a
int Galo, b=00;5
PAM 1.a% ((az=¥)),
oudpud 24
Logt cal opty) (any one ata bTs True tee Tru)
int 25, b= 3,
Paindt (“7 a'} A>BA
©
Pao Id", ar3e%ae ti).
Scanned with CamScanner-
a
Pitiotse Operates: P Biba se x OR
I . L Bihotee Comp Kineng,
[ L grrotse oR
>
Biboise AND
Ge Int a= 12, b= 785
output 9
Pring (yd | a&b)5
ID= OC CCOIIOO
eoolloes6°o
Boise ORD 25 =
ing O=12 ,bo985,
Pmttv ay ab); Odpubarq
Boho se xore
Totazin, be
Pang 3
3 Olput = 9)
1.0" “5
Birwise Compliment.
Mme acy :
Pnee (¥ Apa); odpud= -15
5 SHH operateas Bit sre HUE Operocins ts used
inary bits ethey
ar wight Uireeton .
(9 left shif | «<)
© ight ihe 5)
ms ee Tn The eh “dixecfion
Scanned with CamScanner“eer 16
U>>2 | 4 | ‘
& Assignment Operctns -
= A=b= bvalu eis asstqned +0 480 Vorse
$= Addifion a Sefqamect
= > pole Substation AXgoment
IF division A859 Hroerd,
S.3 Cenoind es atetgrment
ke Fin agit. ghee BSeignmech
2C SBI D
Int macin(
2
Int ado;
Tat oc;
=O print ("5 gy cea),
Print (5.0 C4 2a)
printl "Ha", ¢-=4);
panesSad” ¢ lea),
oO ‘Scanned with CamScannery 5 y 122
PRAT Oat, E*ra)s — Owlpeds 122]
2B 4
Pimseiia, cW=0)5 3etga 24
Pantie wry gy Zor 2)s " uzay aul
Pose (dt, err= 25 Pl ie wl
au eran
Pimerely gt, ck a5 dN nN
Pantha! Cerys SOPH Ay
Ve =24
Penge Za, C= 2)5 ie
4 1 Ba
fq am) Op evetoas —
TP the Operdtor has Only One Operand, So
tis Oninates Opetarn
2 yPSe— Tr erement Operatoy
lecxement Operators
DO Thomment Op eeckor ( +4)
*> Pre Treverent
> f= 10
i xe tt, — As Alay
2 Post erement ‘i x=A
Pint k=)
fe lo PAnt as)
Xe Ott Aza
, Ae ey
Pint X10
Pfint Pen
Scanned with CamScannerDecrement Operate i
Pardecrenn ent Retdecrermedt
N=90 acl Az90
Yeo- nh ye tee Ae 2o
Yea he An}
Print Ve 14 = I0-!
7. “19
pamt A=14 Printy= 26
Print an =1q
Ternory Operators —
® Condi# ona] opera hrs.
Th accepts 3 Operands.
Syn tar ca
( exp 4) 2(