2 c Rs 2/00].
Definition of Software ;-
A Sl) is a collection or prgms CSet ob instuctions) which uses the ress
Ur the Hlw components «
AS pervthe Experts siw ave classified in 3 categeowes,
\e system al, a. Application sit. 3+ Tntemnet si,
de System slo s—
The system slw ts a Slo which does the. Functionall ty for the tH
devices, Live printers, mobile, processors --- £te-
To develope this System sko we. need o& Three Languages .
ty Assembly level language Cotero processor Instruction]
a Colanguage C procealue Oriented programming] KIRAN SIR
3. C++ C Object oviented Prepamming q NOW WITH
ofa antosh Technologies
Sten’ . : ls 9245397245
cor oT 7
[command Use Trtesho.ce] [oraphical uses tntotace]
Single. Usey Multicese, multi tesk mubdiuses
Single Uses: -
The processor aan does only one Job at a time 1s called os Single uses,
Eg MS-Dos
Mult Uses :-
Mowe than one user con use. the machine, oc atime is cabled ag MulsiuseS
Egt- ONIX
Multi Tage<- .
mor than one (Kesh) job is tating place ara dime is called ay muttitesk,
Bgi- in 95/49] 98] NT] 2000 Ime. [2003 | xP] viste-/ #]8 , Andhiod., 105.
2+ Application siw;-
Ain App" slo is a slw which clog the functionalities -fhthe
business oriented applications.KIRAN SiR
now ¥
nolo?!
Caer
leet
Database :
Every application slur eauives datalase like dhae, foxpro , oracle ; S6L--- Bk.
Programming languages :-
AA lang. Coun be used -forthe, communicadion purpose.
A computes Lang's will be used te communicate with the used & the Systerns.
This Computes languages are, classified in Two categeoves.
{+ Low level emguages a Highlevel Languages .
1+ Low Level Languages (LL1's):
LLL'S ae the lang's which can be Eagily Uundestandable to the Syston,
There are System depencient languages. In this -tuo Lang's are,
1+ Machine, language. 3 Assembly language.
Machine. languages” -
Te ts the fundamental Language tAthe System te can eliventy con
be undustandable without any translation. Thyeare machine Ovientest
Jang's thak ute collection 6 binary o& 4's and ols. 8 wt.T, Omputel Gn
anda stanc many denguage withruk erennalasten these ts only 4 deny. Pet ls
Binary Aanguage «
As the users Preber decimal no's we debine to write the decimal nes but
System eoill convert Tinto binary ad's.
The. Compute Meaguring units bits ode, bytes.
* Advantages: - 2
1 Ais the Computer lang. isthe machinemcrientel Te cam be tinolanstendalle
very Easily R vey Foye Excartion process.
a writing 49 machine (ong. dot a Memory Gun Save,
Ee iT BI 31— 10005
Jeavs month © douDis advantage:
io Remembering dogens a> binawy code is not an esay sob
a. Rectitying the Evrors & debugging proces? a ime, baking.
B+ modifying the pram is not sayy.
Assembly lau -
=o a & Lang, ts Tenplemanted by he aavembly cede, This lang-
canbe called a5 Symboltc language. In owl te remember tally the prymng
Coding be implementing this, lang. + Tn this lange lifts types oor Syrnbals will be eased
co design the prgmng. But-this assembly code can't undastanclable <0 the System.
The assembly code cliectty not understendable “to the System so we verdive
“Franslaiovs, They de Stypes. fer high level cocking
le Absembley Av Tnteipretey + compiler,
Assembler: Zt 1s a translator which contrts the astumbly Code rmt6 the
Machine, code.
fa acne Fee [tener Jf aching
Advantages: Sevens Transit? Objective Cade
witts Easy to write the pgs Compe to mashine dang.
witis Easyto tocate & correct the Erors.
Dis advantages -
% To leain the. assem bly Jang. wenesd the knowledge @& Hit.
High level languages :-
HLUS are the Langs which ave Easy to undeystandable -for the useh. They
aye usa dependent bang's
The BUS 1s & Combination a alphabets, cligits & Symbols . TEs called ag
Macio statements. Tt 1S Vey Sagy tang. Since eis genoal English lang. » But the
System will not understandable this lang's,for this veagon we have Translains,
Tnterpreta t—
An Triterprete, ts a hranslotor which Convert§ from Hil's to Machine cone, by
Checking the prgm line by line. KIRAN SIR
et Script C Now wit
Sele yt we sote, Santosh Technologies
PHP = ate-] Cell: 9246292245Compiles :~
Tt 4s a translator which converls the HLL into the machine ede [objectve
cede] by checking the thole pgm a o Rimes
Ege CG cet
This Translators ave not a physical components. Thy ade alto setrhoare [system sla.
Ney toatat translassr ts Comptia}.
Advantages :-
4 ibis Vey Sasy to understandable 4p unite the Prgrnag 70 Huts,
* it ts easy to cebu the Panrg Goele.
Dis advantages :.
* TE bakes more memory -to fnplement “the applications,
* Machine & assembly fang's ate mote eXticient than HLS.
History & C-language + -
Around tn 1960's the & mast tmp. Pygmy fang’s COBOL [ common business Orc
rg] A Gommeical aps and FORTRAN [formula Fransketion] for scientitic®, Engg,
[design launching: ceveloprrent ote fngq. calcalatns ~--- £4].
These mary Apps con be clevelopect by using this fang. but this tang’s can be usec!
Only +0 develope Specific apps. fA this reayon -the psqmrs dlesived to develope a new
t S Pg
‘ong Neato Re Dennis Ritchie
combiond erga hg: aa BrL, 4
(ee) fen JA) fos] ea} ey]
The rome of C-l0NG: Ts coma am BepL, CTsthe a4 setter)
Crtstophes shachy Ken Thompson
Cambridge. mid Peds Bre, 1992 [4m the Ren
We ate Following ANSI ~c TAmarcan nlectional stand’ Ingthue o& C]-
we have Ome more ‘Ce; K& R~e [ kenighan & Ritchie].
Chosacterstics 06°C) :-
% C% an aid —level Pgrmng fang.
% fs wrt, we have low level prgmng larg's in which the System can uncletstard
Goaily « €gi- Mico processors .
And we have Hus Inwhich “use, can undetsiand Eoutly. .
Egi- COBOL, FORTRAN.
Ard “6 ig a Combination a Cow leve! & high kvel pagmng- Treas ik ts
callecl oy Mid level prgrnng.
tg Ck ct.
c-scombined* C supports 44, opaatrs, 52. Keywords . & 4 Separators.
* C ts an Coge- Sensitive Lang. -
Coje-Sensitive means -the lower cose chad & the upper ange chad. hag the oli tty
meaning.
% Even € statement Ends with an Semicolon C3)
x Tec lang Supports Large. St vb- Aibrary Functions,
x
Cts an fun" oriented, procedlite Ovented & structs Oriented prying Jong
The Source code what we Implemented 7 colang. tk te totally cepencls on
tur'al structives tor this veaton 1 Te called ay hin! orientecl prymegs
Deviding the pigm into Small mookules according to FHS operations ts aalled
8 procedure Oriented pignng.
A stucture Oriented Prgrang hoy to Sodisty 3 Giteia’s,
A+ Seguence ob Steps. 9. Decfsion making 3: Repetetio.
Sequence oh steps 3-
Executing Every line o& the. statement without ignoring any ob the Statements
such ype os Prgrong is Sequence & Steps.
Decision Making : -
Every ime Sequence ot ping %5 not Suitable, shod Hime we use the Cendition
statements 19 this pigmng bared on the, donclition Some Statements will be Sxecutedd
Some statemenk will be ignored -
Repetition :.
Exeussing the Statewnents move than one time is called as Repetition. Thoda
to implement the Repetitions we have _Tteratione Concept leopings) «
A pplications Or C- language :-
* C %5 used 40 develope & System sho apps like unit, windows, Linux, Compiles
designing - ~- + Ete
He otto Used tn development a nary apps do's tke Commercial proclucts
% Tees Used th development gs Embedded & mobile. apps -
CDMA phones dependy on the — BREW Technolgy.
BREW —> Biray Runtime Environment bdneles
dleveloped stay with Tava.
KIRAN SIR
NOW wira
Santosh Technolojies
Cell: 9245297045* Gomtng -hamewors ofe alto unttten using dang.»
Direct x
Coxgocom Lecomponent [Distributed component object model
NC++ KIRAN SIR
> Now WITH
tt Santosh Technologies
c Cell: 9246392345
* lang. much Supports geod Fotetaction ustth Hho~
By Using c~lowng. we can develope anothes, Prgnang, tangs alyo Aike PHP, mio
Sobt . Foundation classes, dlatabaye prgmng - ~~~ EtC=
How 0 corite a C— program t-
AlphabetsL-4-2,-4)
Digits Co-q]
igmbols L+ > z---]
C-chosacter Set :. A Cocharset consist ab alphabes [ lower§ uppei], cligits [o~9}%
Special Symbols «
ToKens?- A Toxen is an small unit o& a pigm, Token Consist to Tdentifiers, key
words» censtank, vartable, datarypes ,opetars, & spectal Symbols.
Ddentifiers*, A name which 12 given AA variables , constants rmacvos- ~~~ Bte Ts
called ag Tclentifies Luse, debined]- [case - 1 Senstie],
Keywords" Keywouls ave the Yeserve worely in which the meaning thieartycltine!
by the compiler. all the Keyworels hast unite ™a lower cage. According to the
Anisz ¢ we have B keyeuovels- actorcling to KGR C we have tt Key 2orelt,
Egt- for, do, tnt, goto. enum ~ -~- Ete,
L eccty 897. the adeno) .
Constanis? A constant 1s @ value that doen’ change curing the Execdion -
Oe the pigm-
constants ale ob & typed :
1s Numesical constant’. Q» characte constants, 3Numerical Constants:
The Numdtcal constank ase the numbatype. Thge ale atype .
ls Toteger constants &+ ReaX constcinis.
a Oe the decimal type te Numbers. Thean be @M oy Ove
cletrault it 2s Onn. Tn blu the decimal nds we donot have any
Sepwartors Fnclucteng Comma.C7) eho.
B45 99-8 Layee ~~ BHC.
BA64 19 net vented ,beeg 8 comma 1s preienk tm thd value.
The MIN-NOINge tr the Tntegey constants —S2AeE+tp aLaCT.
rare wee te
5
MSI ce se ke ey kt
Su
higher Onabit ae
vipa
- 4
tor least
LP Tep fe fepoje}
a
3
proot
12 -> least
oriinst
ptrygitd
12000000 = ~ns
There is No O* value binanyoode Sin the System.
Si ep 0b 9 ete se ee 2 og
Peep pp php th pila hh
ath EIE TT PEED we {1
a en ea
-S2368 4 32767 265536
bytes Tes Range 384
vane
Tn Tateges Codegeoy, we can algo have octol numbers and ee) Dos
Te Octol no's cotll be tndicaded by prebia with “0”
BS 9456 5 Octal numb [ ot % = % Chae)]-
456 — Decimak nwmbey.
0386 —> Tali no. boo ‘gis prs in the Volate [not OceL eto ig
pr Lrot decimal)The Hexadecimal nds ustll be prebix with “ox”
OmIS=16 => 0-4 & A, IB, 12-6. 13-D. 14-E, IS-F
Fi ox452 , oxedd onsqa.
Here, Alphabets ote not Cage— Sensitive.
Rea} Constants :
TH real constan's are ogo fractional decimal point no's. it com be BHO
by default ik 1s @Ne.
&3i- AS 924., —l00-09.,
The. min. range a real constants a4» 188 ty Bh
IEEE 454-+locctiog Point Standard :-
(CP xF xa®
Single. precision C bias = 124,
NOGA COSSOCEE
blabla pbb T=
Sign [<—Expooent traction
Character Constants :-
A ched .cnsink ts aL byte oh chatetna Keyboad Everything is treatedasa chat.
“The char's hoy 49 Enclose in Single Gutotations (* >) « KIRAN SIR
The Range of char. congtant tS - NOW WITH .
¢ lary. 5 “ ae a ae Santosh Technologies
ae ee ee Celi: 9246392345
Fe AE Sa elon ete.
T# TE%S O Combtnation ch chov's then TE Ts called os String Constant.
String constants ate always Enclosed 2 double Auotatons c” “).
eg Anusha’, “alan? 9641" ste
Nariables:- A name which ts a ong computes: memory location ts. catledt
@ Navioble Name. The purpose ote riableSte store Some data: The icset wil!
acces by the Vortable name & the compiles will acces by the axktuess.
Rules tev declaring a Vartables:- [res toe dala} _
* The Vaxtable name can be lowes ane, upped. case. and mixed case-
* A vosiable name can't bea Keyword -
# A varie name Conbe Alpha numeric chal's. -
%* 49 Vesiabe name can't contain any special chos's Except underscore (_). a
* A wlable name can stat with chan ad undeserre bud nok cLigtt.
Note's The lengih ob te Vetrialle mats cam accept 86m chox's bub the Compiles
2
uot vead only ist 32 chars, 2Fwult Cidentifien)
Mango Apple Banana
(Vadiable) ¢ constant (mace)
Datatypes '- 4 datatype daxribe what type db dato we can stove in a Vadiauled,
Te ali allocate Some bytes ctr emery fer trevantables
Dosatypes ade clayified in 3 categeoried.
Je prtenary, Dedadypes Cprienitive) ( prediebtoed JC Baste). KIRAN SIR
2+ Derived Dosatypes. Now WITH ie
3+ werdebined Datatypes C&concary) nologies
7 2 +
Primary Dosotypes 3-
This pimeny datatypes axe the datatype directly thtoackd withthe machine
Instructions. every prtmay datatype will Suppers * Type modifies",
‘The Type modifiers will alte, the meaning ce datatypes: Thae aie 4 types ob Typemati
+ Signed 2+ Shot Bs unsigned 4 lon Gee ae nahing bd & Rewer)
dubaul. G3) u °
when we debined Signed type modifier you ade, felting othe Compiler the
higher oveler bit hagto interupt by the Sin + eohenever Signed 7s Specified a
Santosh Tec!
Cell: 924539
signed tlag ts germated
¢5 4325 0
pred Os ve
43%
ifthe Signed bit % gaw, ik is Blo, Hees ATFs SFno., The shor $k
Ts more
long indicates the bytes ote tmewmony the Shost 1.5 leg bytes & the. long ee
yt ee
LZ. int CTnteges) CSigned int) Csigned) Cshoxt
det and ie
owned Specifications ¢
+ abgta C6 bits)
sige
Range 32,163 to 32 fea
Desevipiion —-§ Tt accepts the no's sh- decimal type - Tt canbe. QD O"*.
€g% Bb, AAD, 254, A6Z19~ ~~~ EXC.
Mac's ; fo Every datatype we have mocso's -fe-tind out mane fints volued,
Min. to Value + To Atsplouy max. int- wehove a mace af,
SINT. MAX - To atisploy aminving. we have /NT- MIN.Onsigned int:
format Specifications +
Sige
Range
Desaription
&
Macs *
fou
a bytes Clb bik)
0 40 66.635
3 TE colll accept only the Tolger ob OY mls,
2 B6U,a96u, SUBM6 U-~-- Etc.
3 UINT- Max.
OMT —MIN.
et
oan q
onsigned
res¢
Tit
1
°
1
SAP eg?
£ SF 24 TILT.
PITEEREEED) GAgTTerT:
ie
eas ree Rerars
Noted Exteinally she nds ane diff. bub inteinally the binary cseles ate Came.
"4 4
Long nt 2- Clong)
format Specifications?
Size
Range
Dasestpon
&
Macs
tp de A of Ld.
4 bytes (a2 bits)
~alat 463 648 4 a 147 403 HF
Te ake accept Integer “type OF claia with more range.
BEd, 19672,
LONG: MAX
LONG — MIN-
~64 432. 2 ~~~ EtC,
KIRAN § SiR
Now WI
Santos!
Cell: 924
h Todmoloaes
,OUWOnsigned longs -
forma) Specifications 4 aod
Sige 2 Abyts C2 bits)
fange $ Ot 4 29q A687 Jay
Description § SE accep more range sb- B®" nds.
&3 2 blu, 467 he, 7963y Lue--- ete
Macros OLONG _ max.
OLONG — rain.
Char Csgned char) :-
-founas Specifications: o} «,
Stage + Abyte Ebi)
Range $ by YOi24 eee
oe i ctay a Chas. € muy! leset
descipion Every hag ia the Rey haul acheg single eutrtociony Ct»).
& Ain @,9---
marcas ¢ UCHAR MAX
UCHAR MIN. fo Limits. h:
Note? ANN The above macs estll be debined +romthe Headley fle
Macros 3 ppl — Max KIRAN SIR
NOW WITH
DBL — MIN,
fl double oa Santosh Technologies
ong Conse Cell: 9246392345
formas Specification; o> LF & ef Lt
Size 3 lo bytes C6 bts)
Range & ~ 34 R10 so Seg x 1
Daciptions Otth fractional point accepls apte 19 decimal paras.
eq 2 Ss. 3Uys6 17 4) 23893UY LE, ~~-- S4Cy
Macros LOBL ~MAX
Lop — MIN.
Note? The above. macos ae debined the andes the header Mle < loaseh=
Lat
Fivaly 30 Colang, only 2 Gakgeones ote datatype -y Tategers § nono olsp
Stnte , chails tnteinelly pawes the ASC) cole, which is intege ty pte
Notes- hall the dada typerthe only inte will Change the Siae cleports
onthe bre Mp. Tere Ts 16 bit TeIs aby 14 Pe 7s 32-BL Tees bby
Declaration and Initaligaton a Vadia blest
Syptan t=
3
Gedaarrhin set
We have 4 slonge classes s dataseenene from the RAM, in that 4 “Type! 15 used tp Select 4
Soage class. Defaully we take Yours, Sige Todratey abaus shunt Bling bu debauttty shorts
Sign indicates +4 A VE bud dehautity 4¥¢
&g:.
SB © Inka; M Brokers one. prie-dararype variable, Sepatarers,
sen ee Same
ges
short a; ~ ~®© float Kh; // K 1s o Vasiable & type “float
@ chars,
Ae &| => Ant asb,c; // + tokens
Yntxs
declatation with Yoitfaligation > TNS
cha tedlia = tals
@
© we 2245;
©
@ floats = 4-789;
Here wf we clidn't anole the float bekove 's' then -br reacling a4 t leat we have wrote tha
Value as Se ArTeat 3 othowtse Th treated as cloable.
~ Tht a= 600% s00/a00 3 //valtd
t ite Hae *— 1s abotreated ay varialle, BIneN SIR
& tntants Santosh Technologie’
% int -at; Cell: 92493392343
% Int Fors I iis keyud // invaltd
& Pot 4a3 I) trvaltd // Vexiable comh staat with Alumexc,
*% ot 152135 // fovakid / 0's pot allowed.
% Tok © m03 Mf Spaces not allowed.
% Float e+nos df Spectal chai's not allowed.
Flavors os c/e++ Editors :-
we have dt? types ob edi
the Cc. compilers are,
TURBO ¢
Bvick c
MiICROSCFT ¢
ARTECH ¢
ZORTECH
Larricec
WATCOM C
GREEN Lear
Vrain ~-- etc,
Every Compiler has Hs own edtiors called ay TpE[Intgrated Development Ercan
DE Contains + tee at petems & Jobs.
1+ @ditoy C Tyetng / editing]
3+ Debugger [ Removal o& evar]
3+ preprocessoy,
A+ Compiles Cc 49 machine].
5+ Linke,
tos & vey Editor hos Fts own compilers. Some abThstallation o Windews-% and Higher Versions cs TORBO-cz-
‘ Tuvbo-c editor #s develope under pup 8086 CiKbit >
Wincows—F 64 bit :-
Select Tarboc 3-05---> Tuvboc+ Exe % Tastall,
windows - 32 bit:
% st Copy -the slew th any : Ihe Cor D or € chrive. [42h sume path]
% Open the folder & select install ere.
* press Enter KIRAN SIR
% Enter the Source drive to ue: E NOW wiTH
X press Entes Santosh Technologies
% €2\ te\ba\te.exe, Cell: 9246392345
Iindows XP !-
Turbo CH V0 > Setup —> Run Tien astomabically tnstalled) «
tow to write a C~pgm:-
Algortthms Flow charts Paging Lang's
beat He eta
= A
ed a
"Ny Mend ef matacy
The Pigenng tong. will be Executed from the stmt as maint). The maine) Stope
Contains Set o& Stmts+ The maine» will Execute the prgm,
Tn the Maine) Scope 2 blocks cam be -takes place,
1+ Declaration block & Exeawtion block
The Declaration bleck we declate the yastabla once the declatation ts fintsh we have
the Bxeeutable sins.
lo Statements :-
every prgrng lang. contains “Flo stmis. This stmiy 4s cused to caphate tHe clata
trom the ‘Ip device called ay Keyboaid and display the elp on the screen by using
olp stmt.
Th Crlang the Tlo Stmts are clayitied In 2 categerioes frrmatied tio &
1 Onformatted slo»
The -tornabted Tlo can Capture &dtsplay any type ab datas Me Unterrmntted
‘TIO can cape only Spechfre type of data»
In clang. The =lo stmis are called ay -functons.
rUUSThpat Outpat
-towmatted” tlo
Datatype] Input foutpat
nt — |scanée> [prinbeer
float — fscante | print.)
Chas, [Scaméc) |Prinetey,
String fscanfey jprntee>
4
point-Fe ) oe
Syotar dt print Case defined string" 5
The fixst Syptar ds the print) 1s used “to dtsplay -the uses dletinad strmis on the
Scteen.
The rest Syntax dx print#©? contains only one exgument withtn the clouble auotesc"" 1).
whaever the Stmais we are debiring 76 ts collection ot characters.
Moin)
{
print c! welcome To cD;
s
o-btes Lnvifiog the pig, the pgm has to comple & Execute. fey Compilation press
“ALT+Pa
To sun the pgm “cree ry, Fa only Fong «
Clescre>; te make -b cleat the screen belore Exeustion ob the pigm ue use,
AFA cleasing the screen 7 mares the censor te bling in fist row &fisst colomn.
“To.see the olp on the screen press * ALTH ES” Cit works only tn Taxtoc),
Tothe above pigm the olp not tn-the cee, ode make ‘the olp In bebter uny
OF Rey's, “Cl supports Escape Seanences .
Escape Sequerces?-
Thorde to cesgn the olp ina preboimatied Tetts we we Ssape seeuences
19 CHlargs The Escape Seaniencey mostly will be used to “the olp stro of print,
ALL the escape sequen will be debined with Gackslash Cv) -followed
the chad. All-the Escape. seauences Hl} be deblacd ut any ewhete *the-
Pee ,wthin the" ". But mostly “they used et thes, begining 3 Sndkieg of the$0 thy axe called 05 “Boundartes or “delimeterss
“\n Bhewline chayactes] t- It makes the curser tp Bink tn “the next Sine
Main)
i A
print Cweleame io in") 5 Olps- + welcome-to c
pintee TE 1S pepsin”), Teis Pop's
ipitotec” welcome-fo C\n Tk ts pops"; Sean
PrHOEEC" \avnin xa welcome To ¢ aoe W's ;
1 xR wellome TO CR.
3
“\t" (Tabl:- The-tab coill makesto move frame. by-frame not by chas's.
Moinc?
4
paine$ Chagall),
printt C'ia34\t 59+ Bus cunoratneat frome
protk closaytalte"; PTAA 56
S achar's Bechars, KIRAN SIR
NOW WITH
Soe Santosh Technologies
Cell: 9246392345
“\b" LBackspace}:— The Backspace ufll be usel fn clevelopment. c- passuod legis,
Moline)
qt fl na 1235678
Print? Claz4\b 5648"), jagasey
pint? c'iaaassaa\bls a cane
‘\
B pints Cina4ib \b sere "9: princec! aaarb§ £43")
The Backspace Move back One. postion. ME asGeas.
\2" LRetasn Comiage Retum] :~ The \i makes -to move phe Cuser 09 the Lume ww 06 the
masnt) fi AS postion [48% cole my).
le: Anu
&
print (And), aw
PinkeC anal yc: a
Printtte" Anu\rnlagti; AAG
Ssaac
Program for Ecmpe Seauencey :-
Maine» Olp::
; b- Cast
printé C'\nab!); a iar
printéc" \bsi")s hat
printt C\y hat");
a
By ustng pft> TE ts possible to display any chor on the screen: Tf any chat not
displaying use the Backslash & followed the chas tt dUsplay that chavls,
asec?
1
clusewed Op: welcome te “c";
prc'welcome ta \Yo\" 93
;, , Frit ua ave getting Error boa complletetondt undoes while thee
EPEC WMD 5 op \\y [ts rospace atthe enteh te LQ seuble ucts]
rn S50 wemmatnialn Space, je :
we PPO: ope Pace, 18s PECAN Dy
RPECNDS op
2 Cc tsa procedine Oriented
Prgenng & function Oriented),
W whenever we break the stmt we the “\’ Fh indfcation ot the shm-islontinudy
\n —>Newline cha
\t —> tobchay
\b -> backspace
Ne Castiage Ret KIRAN SIR
Wee NOW WiTH
V>\ Santosh Technologies
\o ~ > Null chay Cell: 9249392345
\Q alert Sound
\¥ -> form feed
Nh > Hdiigantal
W ~ vetticat
Ole: Cia Procedure oriented prgmagh "Orica,
Note:- Every éstape Seautence is a chad 8S A byte of memow Space.* &y PAM i—
Mainc)
i Ms
PC Relo\n'y
EC! welcomal\\Insanthosh'):
PFC welromeWNI\n santas.
PFC welcome\bib Helier): IR
PFC weteome Iblb tell!) « KIRAN S oe
ce teneaeg Santosh Tect moloa'e
PEC" weleome yelp: coll: 99492923
PE Cellet wetcome’);
*& maine)
1 ;
Escapel
chiserey; oo seauencer,
PF Clescape \Inln Soeuencet'D:
gether:
4
Getchos3-
Suspend fia chile, until the uses press any Key on the. Keyboard.
The Actiol pupose ot geicht> fun” ro Captute Nondasa Keys.
GACH 7S coating 48.004 chat “type yp by using getchc) ¥9 the goure wecle then we need Notte He
whenever the compiler teak the getchO) stme it make the pigm fo
ALTAP 40 gek the ofp attey compilation
by wiinggeiche we evillacce, date ray (A2/6-9, enbr---) Ras nion dada CF Foo de TRI ,page unl
down) Keyge
By Wing guichett) weeny react datarey. gechecy read both aecia L Nondala RY tnd getehe sie bebtes,
3 BEd othe kine ,
Comments:— — ushenever Ff You wantte provide a clocumentation for the Prgm we
con write the clocementation by placing anomndls. wWhectéve, the StH, we place ingmeG,
Thee will be Ygneved by the. compiler They aie &typy Be Gots
ISmgle. Jtne cmt Ci) ae multiline omnt CA *))
Ying
Notes Clana doeint Supper Nested emma. cee
2. Ak print cltello?)-
7% pe c'ttelio'y; OP. wecom get errors bigg Bt Nerle! amis,
PE CAnuN di /
PE CHal"); x 7
iOwpaint#o-Siyntan -22—
prathCuserdefined shits with owns Spectthantion’ ag. o1g2,--- ys
The Seyntan vb the peO used to clisplay any type ol ap on the Console Swen
The ang's aun be. acteptect Minty Net, entth formas Specttreations ,
The. aig's can be vatinble ype, constant nds & &xpreitions,
% printt (Arad Bred", 10,28) 3
“Ato Be20"
Olpt- AL 10 Bt20 ‘akeinally takes ag collection we char.
x pe Cheba “o20)-
“io20"”
ole. p20
HPF Cll od", 00, <1:
en ste KIRAN SIR
: 100,-5: Now wity
7 = (00,-9, Santosh Technologies
5 PEC Md shel", 190,200,208): Cell: 9215299345
O1P: 100.200
PPC efad od sod" 10,20)
Op 10.80 Av
x Maing)
Olp
i as
ct ae ates
pecioes'>: >
pela 442: ve
PEC shck 243):
PEC Ina 43 = thas
rt gekcho : “tapenion
ey
Sean) i-
rey.
Sant) %5 an Ip Rim eahich com caphoe ang “ype wo data Fr0rn the Key
~boatd. we cam accept tif's -for the Vastonies 7% 2 woxst
'* ob the Hime a- Vodiable declaration & Initialization,
intas83
asBy
2) Byusing srantcy at the Hime at Exeuction. The advantage by Scamtl) fun?
eveay time the \alues o6- the \odially an be change.Sytaxs-
Scant (“format Specifications! agit, & a2, ---. - Sagn);
The Zankl) vb the stag Fe wPthIn the Wo only contasng, format Spe oi Freextiaey,
Remmaising 98 ot any cootype must be cebine with & tndtcates actrs (eye)
The cigs must be Varfable type only.
Write a prgm +0 accept g nds find the sum o& ands?
Maoin¢ )
7 weclosastion .
nt Aon, Sum 5
chsert!
MU Toputs
pe cléntesthe values 3 ")-
SFC" shal pdm £0):
yy logit e
sum = +m;
Mutpat be:
Ph Cisum ee 2 nds + +h", Sum);
geleht);
tee
%- Nt = MtE+InE
Float ~ flea t-float
woorks-for only nds.
thot = Pt ttloas ob ipa ones byes coil dominate,
frvaltd = chat tchey
Tracing Ctr the pgm:
Toute « ph ibaicthingsocbare-te
anole ts,
B+ Typeste pAgm Cnt eSoad—~ )
Alege,
KIRAN SiR
Now wiry
Santosh Techn
logis:
Cell: 92. 3392345"
Enter the value 34 2
6a
Sumib- & no's 5.
Lovignmers aliiiyy dane eith Righttolett.
“a
A pigm cam be Trace Mneby line 7 understand more clearly by pressing Fy.
when we tracing the pigns we can watch the variables volues by “Add wotch”
Centrl+ Fa). it the add watch nok visible then press” Fe",
Op 1s Restricted ey 2 decimal points .
“Chel Fil” Cplace the cursor af Reasire! word).
foots.
Help i= Ciseristt)
1GUyaad
Maine?
i ope
‘Int a5 32168
Floor; — 2-168 - 000000
8; 32568.
ae aaterH Fa BETH iodoudle int= tot riqgt
Pw BRIT Hy | Be 8 T6F HFS sist alps Lt herd
ents Pa 32164-0417 ">" gaee+000000
PRC abd MF opud,a,fasd; SHS > 22968
etch 5 KIRAN SIR
q NOW WITH
Santosh Technologies
orden) wea iiect
p Cell: 9249392345
= stdlorh >
Fie ThMsion Macro ras
. foldername
Preprocessor clivectds (to.substitute prgm cock) -
whenever if we ode using predefined furs tn the pigen we have to debine that
elated heady fle inthe Prgm by, using “getnclide” preprocessor elisective, « This indi
makes the file contents fp be added inthe py. what Ever the stmts Staris with SHE
Tinyare called of preprocessor divctives. The Job tthe prepromssos dinctie 75"F
Substitute the prgm code. —
plactng the heade, fil 1s optional indhe °c , but Vt ts mandectorg
TBetterto place in Any Jonguoge .). Lin crtis optional bee, C18 basely checker but crtis. shag check),
Debugging the program :-
thenever a pgm 7s take 7 place, a prgm bas to deloug when de bugging is taken
place -thegone diffe types sb Eris will occurs,
Differences blo Exroys, Bugs & warnings ¢~
Exsox3- It ts nothtng but mistakes 4n the pgmng Jarguoge Thee Bros abe Sxtypes ,
I Syren Evers Be Rumttme & Execustion Errors ,
an"scPr!
a. logicak Errors
1 Syntax Exvors :-
Syntax means the correct way O “grammar” ot uniting aomd & Saies ve
cmos , toclucttag all the prope options & command Line stmis.
Whenveds Hf we ot follow the cule, ot the. piging tangs this Syntax errmis
a be fosed. ‘This Evrors can Basily can entity ky the pymr. B93, + eot)]
Clearly show that belp wtih Dine no.
Sg! 5 missing, writing the Key wool, tn Upper Coe, - ~~ ctes
FS 5-10 Helpwhatts the Crrot FL 9 Total detatls of Srey.2: logical Exvors+
Semantics meant the logical meaning ob a stmnt » Sepotte from the
grammatioa Structure. The logical mistakes will not Felentitica by the System,
Hs purely mistake by the user.
8). for Caleulating the net Salavy ot an Employee the formula ts,
Net salary = Baste Salety + Alloxonces ©) Deductions,
But Amough oversight,
Nek Salou ~ Baste Salary + ‘Allowances GB Deductions
3: Runtime @rvers (execution error} erin ital Oe.
whenever the User pox coreng Tip's a4 values, this runtime Errors wil] occurs.
when quntime Errrs ts ccur the compiles aitll take the contri & raises a prectebind
error moys « This type ch anceps Cauled ag Eyror Fearelling. [leeben'e Sappst execptig hand]
€q: qivided po. with geto, Fiacling the S2-100t 4 Oe nds - --- EH /
There ts @ chance ob “Linker Crvets’ can be bakesplace.
‘Bugsi- Bug ual be 4akey place abte\ the errs ts completed . This Bugs
ill be. -yolised by ‘the Testing team . So. Bug 7 sdliff- when we Compile with Ervers
Warnings:. when eves if you bdame the stmis, the simt clogn't baving ony
meaning OF tha Himey wodnings will be-vatee.
43 @- In place oe Sumaatb; Wve uitten thy Th wise; a warning
03 Code has No ebbect+
Cnternal Execution st C~program 2 -
The Tnteinol Exeaction ab C-prgm will bakexplace on 4 stages.
Text Program: The 48" gkage Ge the C~pigm fe the text pigm It contains noe
only’sc! pram, Lt contains predebined “su! File, user debined 2 Supporting file-
So, the. teik pigin 15 a combination Gr high level Sang & macro Long. 1s Submi (tee
sto the pre proceyoY Stage - 7 :
Preprocessor: The preprocesoy tso 8 stage ot eur’ prgm the stb sirthe preprocitey
imetiate), uhich contains |
‘replace ailthe macws Ggenaate a file with an Extension ob af" [tern conta
pavely only the HLL+ Since the compile, tan understand only HLi's, TRIS ef
File will Submit to the mpile,.Compiler t- The Compiles euill vecieve TM code with HLL Every ins? os the HLL
ts veplaced with the apembly cede ob the C-campiles Rgeneate a étle withan
Extension o& “sasm’. This assembly pym will be Converted inte the objective code
¢
by the ‘apembles” translatd
Fionn the. Compiler we get the file 0 Sobj"
When we press ALT+E4 , the objective file is genetated . Th7s File cay!t been
axes place when there 75a Syntax enors
Linker:- The Job ot the LMke accepting tha yous object cece WEthe System
Ubrowy fur's obscode. Te lenky both the tle i# thete 1s no Linke Brrors
then Execubve file will be genetated with an Extension ob “séxt’ file - This
ile will be genetated when you press FF Clinsing) Option.
Same
e KIRAN SIR
NOW WITH
Santosh Technologies
Cell: 9245392345
ae
i
Ke, [stm- ene }—sfloacles- CPO]
exe File witha havieg the Source code the prgr
qn Execute
The advantage ot ~
TH get the Backup file press Fa morethan Oneg.
[ie press Fa dime file will be Sawa, then prea again backup ill be created, Backuphlers Gand
cfothe Scurte-file. if wt lse Sime then tyusing sumbaX we will manage]
C- olp-file 7S a plattom cdependew. C~Pxgm fs portable.
Dos
Tuxboc.
exe oy
WOIKS on Das/windows, tniafinar eout
Gere)
(TE dosn't worn )Operators:
A opetator 18 a spectal symbe) which uotll be Manfpulosed on Operands.
S31, a © b~opsend
Cy epaate
Fo clang thee are & calegeorier ob operators ave exPsted.
1+ Binary Categeonry 2 Unary Caveogeory:
The Binary opoators are the opelatorS uohich will ¢ Manipulated on 2 opetancts +
£9:- atbs
The unary opeatos are the opeators which will be manipulated on Single opetanct.
& -as
whenever opetators ave, considering cotth an Expression we have Te give the prio Hig
sb the opaaters & solve the €xpyestions.
What is an Expression :-
The Sequence v& optatos & operands that vediucey to Single value atte, Suatuation zs
called an Sypresion,
&- GED B D> GCS > BOTHA-
when we solving this Expressions bored on the prfovities Tt hoate takesplace Sometime;
Some operators upill have the Same. priority. then we follow ayocfasivity .
They ve a Types
|= Lebt-o Righ! Clebt onoctativi . 2: Right to lett C Right Anociatie].
Cotegeoy Opeertors : Associatturty
bert Cc) -E 3 —~——> I
y [Hance subscript PoInECATe, Member accent, Lebt 7 Right.
unary b~ = tt/-- GH, Sizect tyront] Right to Lest
Not Seay mines bey PetY sree aot Mi
Ceropheme ims play fin wen
rh
Antthmeite pa ia fo C Remaindes) Lebt to Right
oe LOR
Brheise 2% CAebt shift Lior
SS CRight shife) LAR
< I >=
Relosiona! —_isitnan Aiton greta tan gan than a
d=
Nok equal'te.
y PST tat eee RE
Brhwrse Exctuseok
1 Bihote ofJogteal BR Clogicat. And) ee
1} Clegicat or) Log
Congiton! a: Right- ‘fo Lebe
Teanaryopeiath .
fa See ae
‘Assignment Ee Eknu Fe the ps we een an
amide
comma, , Lie
H+ /e-
Post Tncrerment elec verrons Right to Lest.
Antthmette t-
Expression od bt Expression
siz & —-&+d00000 At pa 2
als © 0+ 000600 Ah 5 a
Soleo R Rs 700000 A Ye -or =a. Leonsidear Aumescctth Sige]
300) 500 © 0+400000 ~4A0f0 & ~2
Bo/a, 2 20500000 Fels °
Tht >
70 fe ano ove] | Serer dtl contadny
Floating yobs,
Note Mocs operated doesn!¢ Accept. floating point nds. Ht we ant Fo Implem
Floating pt- ds #8 mocks opuacteh we com use @ preclebined function Frmade
% WAP accept a 4-digit no. display the no. in yeverse. order?
stk Include
dk iMctude
onaiing>
t
tak 0,2:
clysexey;
pre" ented the vabuer")-
stoked" Rad; [11826
Mlogic
XA Joi: /] 6
pected 222H6
a= alto; Hf 7§2é|0= 78>
KE Aofetds (( Tr
PEC fae 1
a= aso; [8
= Qofolos |] T8l10=3
peel aed, ar lle
asa/ios M+
PFc"led", ads
getcher;
% dp: 6284.
KIRAN SIR
NOW with
oa. orn ‘hnol logies
Cel 2343
¢
Tepile KIRAN SIR
Now WITH
o=b<=3s Santosh Techno
babes Cell: 9245°9-
Jogies
43
4
PRC inetd -etedettorbti0) s
&
Metee*
WAP accept a 4 digit no- find the Sum os the 4 digits?
Matnc)
t
vo fat 6um,a.sumeos
Pec! Enter tourdigit no");
SHC", Bnamy
A= numep io;
Sum Sum+ts
Aur s numlios
A= NUM dfei0+
Sums sum4n! a
Aum = numlies
A= numes lo;
Sum esumrz ;
Bumanumed 7
uM = aumfio; _
Sum =Suma-num
PE c'cum ote sled numba ts", sum?!
Gerehery% Find wut Expression:
Flo ce, $= 2/a.05
C2519 *CF-32);
€ = 619.0% CF-30;
Cz CR-32)% 5/93
* write a prgm accept an ameunt Th wpecs ind our the denominaiersin iods,sds
~ & ids and display the denominators.
include < stdio-h>
apinclude < conio-h>
maine )
Sint num , sum;
PEC" enteythe value!) ;
St Coma", nam)
Num = num ef 1000
. KIR
Num = nam/jo0: oN S
Aum = sum num/lo: Santosh Technology
Aum = numsleio0: lls 994539, 09°
num = pum|ico; ae
Dum = Aum o/+105
num = num fio:
sum = Sum+num;
PEC" value 7s", Sum);
x.
% WAP Accept & var. value & Swap the Var-valuey
Main ¢) e
it be 20.1
‘nk O=20, b=30. temp, S sq bel | ac2 bo
clsscre); ass be | Arq ob)
sted", Gajkby,| a=a+b; | azaxb; | b= catb)- (a=
Son . b=a-b; b=alb;
oe a =a;
b= temp;
PH Clid «fed ", Ba, bb»;
PECIABTA swaping at sfd bi shd'ya,b):
4
Ae — accept oo Find the Sum ar 27dz lagtetigre »
—_~_L"og WAP accept 3 nds Swop the 3 Var. Value?
Magacy
{
fnt a=30,b=20,C=10;
Pte" of ted", da bbc),
Osasbre
aza-b-c:
a-b~c:
be a-bc
phcl'apter swaping a2 dsb afd, C2 od "abcd;
3 KIRAN SIR
Maine) wow WITH
a Santosh Vec
nt a= 300% 300/ 3005 Cell: 9245592342
PEC od" ad;
3 : Ona
“Tinbo ¢ > MP. 8086 ¢ 16bitD
[o-65525] > 300x800 - 90000
~~ 300 30
= 40000 326+
65536
94.46 $200 = 8
wehene atypa dh memaig will be toks place , Compile Hme memoy & Reo
cHime memories. Tats Run dime. memories asill be changes clepency on the bit MP.
Pe Is an [6 bit edits LiKe Turbo-c, we have maz sua space 65/536 [07
E55an|. TEAS Be-biE Bdlts Ithe Bopland .- gic, wehave millions of
‘unspate. The above prgm ux ae Rxewating on U6 bie ‘Turbe-c the Expression
BO 40300 Fs 90/006. HRS mut ob- Run Space. So, the Compiles make you to reduce
uottbtn the range by Subshacting “from ‘the. Run Space". Then clevicle by 300 tease
4.
— 65526 2-0
3. Meine) Eo
4 keep itor me8
Tok a» Avot 800/200 5
toe by
peer “ges scons
Pt Chal sed arb): |] 124, BOO
Hae, 40000 TS esfihin yUNspace bus not in vange ob He range wt Sgned nt,Maine?
_ t ”
pbe'chal” 300%200/100 3-55
&
% meine)
d
Int A= 32000+1536",
pt C'sha",a9;[/-g21000
4
% Matnt?
d
dong a= 32167:
pe Cid, 92)/- 327168
&
%& maine?
t
long a= 6563643005
Pb Cole); f300
4
Relational Opeiartors :~
KIRAN SIR
NOW WITH .
Santesh Technolosias
ates Cells 9247292343
The Relational expression ts take place. by a valtd com bination of numeyte
Valls, ourneste cnsinis, & velatinal & Fauatity opaocors.
“The Relational opetains always rehnns ithe 440.
TF the conclition fs Satfsfied . i-e: Non-Ze0, Tt yehansd- tt the conelition ts
Bao, Fe vetans "Zero",
%. Molo) a= 455; ow? Fate
4 a a=l0==0, | 1CT) Zoo
a =302: /a0r) ae tne
PH" sled" ad; A=lo>; invalid
PRC’, 524); /locJa= 61>8; /] 4cr)
4X a=61=65 /loct)
A= >4)+ (5243/2.
Q~ D>g>3n2>1 >0>-15 //4(r)
a=5>4-+5>43 [oe
samt
S40
* Maint)
tat K=305 .
4o
PE Usha «led hd K2530, k= 40, K!Rel
>
4. abd eed", abs
PECs aby
x dlisploy is -from Ltr & dataflow Mto Stack Ps Right ‘fo lebt.
Foals Aime PHLSE weave only ee aectnuny 6; Rink, mak depends onthe opts auecaty’]
3 Mofnc)
t
M , a
SPC Moled ood", Lea,bI5
c ind", 2,2); Fa PD No
asl a
Tat a=1,b227
PECs vd bs och, abr: At 2
~ Rol
ne WW at ad 63 aed", a, avo! fi 3
Cat ed bi od", atb,
7 eae Us 3
ui
Logical Opaates *,
The logical Eypression is a vad Combination tr ligical values, Variables & operates
The logical operatas can be combined with relational Expressions.
NotC1> it
Al B R
oft 0
tfo I KIRAN sik
jl son nt clogies
Santosh Techno
Cell: 924599"
A= B74 && 4333 //4
Lg iss
“According +0 ther IB opucctch b-tore, conclition ts dissatisfied te doen't check
the Remaining Expressions .
Attending te the OR Opuctd bee condition ts Satstiech then Remaining
Conditions cstil noe check.
aes M4, the both Valugale nongelo 50. olpisd.
vost
O=4 N05 /)
A= 5>4 && 5710; /16
A=Hr4|| s>105 ]1)
= IF % BA 3s Ih
A= I+ C2kh27+33 1S-
as éllos Ha
A= 6>6 i] 5753 /Jo
Ua=14 silo
G
a aelasz io
~ as t-tos/lo
a=|-39; /lo
~28: flo
ie KIRAN SIR
o=14; Mo NOW WITH
aslo/! Santosh Technologies
> 123283 //0 Cell: 9246392345
ae | Hs23y; fd
Sigeds Opeartor:- The Sigectr Opoatos 1s used t Estimate. the Sige & the data-
type or vaatables, -funls--- ete. The Sigeol Opocite’ always veturns an Integelake
*% aktnclude climitseh>
ait Tnducle
eatin)
L A
doubles: ole:
PPC" sigec Tnteyert eed \n”, Sigeot (tn) 5 Sigeoe Totega s @
| Sigete: Tobago a My
PEC Sige ob TakeGer* olel in", sigeat Chet): Stace Hoak b4
Ee os 8
PEC Size oS % ofed in", Sizeb- Cs): a °
PP Cold \n!, cigeot Cchay)):
prea be man. Totege 332767
: =gch & elec \n"', INT-MAX): MBx + float ¢ 3-40282 e435.
PHC! man- Flood 3 eG \n", FLT- Max) 5 :
gaehiy,
&.
%- Maint) jane
psa
cme seyearaaise
Pi clehd ahd aed hd hd spl, Sigedte 45, SBE’ A, Sgeth S, Sgect- 0, Sgcob(327168),
Sach 3278)
Stgedls- C0x234) 5 Wise
b op. aalets EM roe
. cece datatype the Sgeth opaat\ have Gracker ts not Mmandatoy bur “hs clatatypey,
3 Maine) 15 Mnust-& Bhouldl -
pe C'olotsofcy", Sen C144 65), IIb Beats 3
4 Pree
Ole. $ AS Sablon A64= 8468 9# Moiac)
4
chad aries
Float cid:
PFC" shirelot ciou", sigedts Cath), Sigeti-Cbt0?, SiBedlr Cord)
4. oP t ag
Type Casting: .
Converting 4m one dedatype to anothes datatype #5 called as Type casting
Theyare & type.
ls Tmplicte Be 2. Explrc?e Be
Implicit 7 C2 — The Compiles Tesele- will convert Am onetype 10 anothe, fype Steet
ctype ob casting is Smpiectt Tee.
* maine)
bled", 5)2//40 CAscet cocle 362)
gecho;
Xy
Eyplicit TC. FP the compiler unable to conver then the Wek explicit teas ty
convet 4m me type fe anothe, type ts called og Expl ch TC.
#8 rpsn0) Maine)
i L
toss, bez, Intassy b=2+
Float ZO; Hloas wo;
wmoralb, wo = Cfloat)alb;
PPcYot", 2uo):fla-oneem PH Colot", xtor: [Ja-sor00%e
gechoy; gether;
a. 4, KIRAN SIR
Sypban i € Now wit
Santosh Technologies
__ Nadsneme = Celatatype) expration “C311 9946392345
Sei- e BatE T4153 /] Splice re
© Int MMe, My stot,
Hock avg:
Oe = M+mMatms; _
ag~ cot (3007
a jl ETC,
Og s stot Jags
JAssignment Operartors : -
a0 ¢
Assignment updation opuatoy
Tok assy Tnvase:
sayy OPEL. , sopiatey.
spent as6:
nNum= nur) io; Nun J Io;
SUM Bum Mumejeio;, Sum 4 snumisio;
‘eps Ropactor s
Modulus Opeiadoy doenlt work with -Hoading paint values .
7 Maint)
brows kr
3 A.
plata Ait! Sone, row SIR
asarl: (updated catosh Technolog,
“ ‘ells NClogia.
PEC odin ads ells 82433999788
Otel Mapdosedl SN 49
Pcl \n 4 ars
arty 1] not updated .
pt Cobd wi ar
PE Cobh in" atid:
PR Hea a, OP © 61787
gocher:
4
Note:. The updatable stmis in the memory locations,
A=at3; atel, atts +tas g—-s --a;
Thovement /decrement Operators —
‘Tings to note z—
Att, The Result t the Expression 1s “the Criginal Value t& ‘a!
&gi- aas
Ate: 5 \
B+ 440, The Result tb the Expression is the TA value ab’
€gi- aes
+ta=6-
3: Q--1 The Regult o& the. Expression isthe oviginal value ga.
6. asbs
a-- 255A+ --@, The Rest ob the Sapremion fs the Ned volte ob a.
Type-t-
lype-t The Recognigation ob typed. , Tt Rs always, ufthinthe pratt C7 wrth
&- a=S5 ~-acgs
_ Single. argument»
K. Maine»
1 nt 226;
clrsereys 01. Memoyboced’”
Pte value t- 2% ofa in", x45 5 6
PEC value ofr 15 ofd Wiemae Yo =
phe Value O22 oa Way z
PFC" Value tb x1 ed \n", +4 &
PEC Value rar eid i rears 6
gecho:
TYype-| voit Eypreysions 3 -
Main)
4
Fnt as
Q=1;
clyscxe>s, 2 a
inept
pk CinshaY, 440 SYA #449); [Jog
Pn shed", AF x CALS has Ie
PEC \n abd", gw Ree, ig
Pore vneled", HG wg at 'e
PoC ind", aby PAOD Ee hos Is
PEC ro, alee PAA: fy
getchor;
4.
KIRAN SiR
NOW WITH .
Santosh Technologies
Cell: 9246392349
Typeni- Type-2 alo wstthin the pets butte hag more than 4 aig.
Heche Include 4stdto. b>
maint >
$NeszeGs
PEC A thd abel, ab, HERR)?
Y <“RvlType-® with fapressions t-
b
P=] ttez atts!
Vota maine)
brea 4023
a
abt
PEC in ohd ohed’y Fta *bee y att + +4095// 6 a antes
~-aeay
Q=b=2; BRE weet
PEC \nehdh eal", a k++» ae - --b95 /] 40) b
4 <—Riot
acbess
PO nad hd", a-- toes, —-0 Hb --23 [le
Tk -
ype Steps to follow :-
Main(> Ie Take the memory blocks.- every thing update
=, 4 1
tka; oe 1 Inger memes Bloos
ere a+ ;/lazari B+ oitte down the expression.
ras //acaty| Peter"; Me zeyrtserter 2Q.
pechnaorsic | & B+ Th Expression Contasn post opaaith Temove the
y Post & write. down the Expression again,
%. Meine) gas
q A> And -then Assi i
Ine Hyd s ger: oP Prowty
Ser;
AEBS 5+ Finally update the post values inty Variables
years Coemors blocks)
PEC a3 thd Ys cha Srey da) or
gusty: KIRAN SIR
te ' x 7 . NOW WITH
PEC Yrend 2 etd’ mg); [166 Santosh Technoloies
x, Cell: 92 5
#&. Maing? Oo
1
Ink asd, bs b= att + att
b= att + atts eis
peas thd bt *hd"a4b?: [Jae
y. a
%. Maint %
L tnt a=5,b; Hot 46
betta + ta: 8 &
barons Gia}
eo
Xe ba att + +40; Ize
b= a4 +40
& 48
® beatt + --ata-4 05/520 Fy]
bzat - potest tte YS
5 88
© Magnc)
1 tnt aztob; a. &
arse; [#)
beat + 44a; bratt 2 Ha;
PEC oled chad sd hd", by A+ 0,440); brat tay
a eae
%& Moin)
L tnt u=5-Y=4, 2-34
PPClate ed ya old B= ofd Vn" x, ya):
4=-45
+ a5:
Ae Yr t atts
PEC a od Ymod groed \n") YB
4
% Mofni>
Nt 8, 125 Y= 10,24 bea;
chery;
Be att ye bla;
Pre' oh", a2: Mho
&
KIRAN SIR
NOW WITH
Santosh Technotc ie:
Cell: 9245392:
&
Bast pt
Bayer
224 YDT BT
co
Gres
Beye baer
* De
A a &
= att ~ —yxbla
3
Be nto Held wy S- “NAB © B- 22/4
352-8210
VvCC Thcvement [decrement opetaters wlth logic AND GOR Opearters : -
Cc According “o-tne OR opaater, bebore condition 1s satfstied there t¥ no need to check
the next conelition .
‘Peconling cto the AND opaator, ebore condition 7s dissatisfied! there 1s 10 Need to check
+ Matnc)
Tht abc;
clrsert
b=caL
az +4boi||+tO6
PEC aed elec otek") ats Bic.) y
ee KIRAN SIR
3 NOW wiTH
es +4b>2 |]44c51; |} 122 Santosh Technoloties
cel, 39
Ga tebe bb t4esty [rae
Ae +4b 5286 44051 [Jot
brow det;
= t4bsi|] +4e>1Ge +4de1; /fyat)
A= Erb] Geer dh+edoy); Jf 21
B= Gb [| +451) Ge pedo) rain
Comma Operator :-
& Most) + Mosc)
d into; d
A= (342, ~5)12d;, Tata;
7 A=3t2,-F 125
PEC" oled", a; ff 2
gehts; Pi-Celd "1a; [IF and gives warning 03 Code has no Ebbect-
% f gechtr; cfoabbeck comma we have to bade values in ()
2 NbINC) 4,
intay O€ = loh2
e@n0x)2.
eltserta; = loH2=120
A= 10;
OX a lo+27
Por"ofocl a); /f20
4Misallineous Concepts s-
As WHT Opaators rethums a. yale Stonilarly a tun alo retury a vale,
bub ecieving that value %s optional. fey Suppose a ptt) not only Atsplay the ofp.
Fe ako vetums avalue. 9s weit, prt? accepts exruy P0- 6lr ang's but Tb return,
The 486 ag. values. es with athe “ "Cabta Substituting). SEO) also vetuony
Po-th args with in the “bub only the format Speci froations.
%&+ Maint)
inka; ecut gn
2= pk C! Hellorid, 1003 // Hello1oo
© pel Hello IsflHello
PEC stdin pt Cleled" 495 1/4
gecho; KIRAN SIR
% A Now win
% Maine) antosh Technolozieg
4 Cell; a
PPC'shd") pe cHello"):/] Helos” 9245392345
4
= peC'hd", pect setlo!'y)s ft
pe Chole") pe Cold »laAbt 4 10,209); // Jo aohtt
%. Moin)
dana;
clysexty;
“ G2 ps ¢! Hatoled Kiron”, pe c'se2"))-l] Halgnoan
ae "a3 > > Op:. SeLstezaxtxang
HH FH Incluclecstdliorh>
maine )
L tnt arbie;
A= pt Cuelcome Santhosh”):/] welcome Santosh
bese CMopd oped "Segre l] avetaues retry de Chee, 26 tly,
Herbed values are 2030
PRC Ve od steak poh “Var bieds/] 1542120
a isnclude ,
main { pct (noledl lack lad "09s 21023 f] 1100 30
Tabarbicy uy
bec =t00/
( D too
pre nad obd ded2a, bie); I BV 100
a= PEC weltome Somtesh sh’, PEC 'Hetlo ewan) ;f] Hello Kisan welcome Sartoshit
OpptConsid oe soctind 4, oeclold wid 4 beg arbrf\n214 foo (00
TT entatd values ore 30 30Control Struchivess—
Upto “ight now we are tplementing Seauence ob prgmng tn thrs Every line
OL the stmt, th this every simi fs Execiteat Sep by Step, any Stmb wTllnot be
Ignore. Tn orclex +o Ignore. some ot- the sims at the -+Hme ob Szecution we
need ‘te Tmplement control Shuchne pigmng- in thts prgmng. basedon the
Conclitions some stmis twill Executed & Some strts wlll noe Executed.
Control structures
Dectslon icing Looptngs
Gencltttone stents ) © teaations)
“Ternary opuatd Receemeee memes Stok
a) ional contre Sims
pene ‘obyy controlled stmt
Nested &g.- fos, while
smutich Exit controlled stm.
&q - dowhile
“OP Condi tonal uncontrolled stig
€qi- breaks, continue, end ee)
Ternary Opeator:- 4 Temany opaatos it uses 2 Spectal symbols *zand"s"
Dectsion Making ;-
iss Tt check the conclition, +f the condition ¥s SAtiSHeA then asics the’? whas
Eve the stmt 15 pre ine: Cneaetedt. 1 the conclition 1s not satisfied jaates yhe’
Mark Wwhak Eve the Stk Ts pr- he Cxecuted .
Syntaat- (cond) 2 stmea 3 Stmt2 5
Fa EHhed ob the case only one sim Is Execute,
* WAP accept a ne. tind OF tne gpven no. ts Even ox odd?
‘inclucle < sidiosh>
at Include
faa LKIRAN SIR
Ak num; NOW WITH
Santosh Techno}
i;
PE Center the num!) Cell: 924
SE Clo", &numy
(um ofa==0)? peC'even!) s pod"),
gerchto;
% 7
*& WAP accept age ab the pason ,tind cur the person is &)
Magn ().
4
le #2 Vote or nol?
Tat age;pec! enter the age 3!"
S#C' bed Lage;
(age >=18) 2 pec” Eligible"); pt Cinot elégibale?);
gercht>;
#. Maine)
nt as
B= Boa 7 loraos
pectiedar fo
gacher;
4
X G=3>4 7 lor ao: //20
Gz lPars;//e
a= 0! 10:40://20
= B>e>12101 861 {20
a= H27 43324
G2 4985 Jf invatid, re ts no combination
on ra s/f RT: wean
QO 132432/invwaud Were enn sone
A= S>2.8has! 2102205 /h0 santo 740 639?
a= cell
d-4>4e Hay ffe
QS B41 5267 barior>aisals
B47 5<6), = B>47ItZ =3B
56% 10x67 4280: 203 /Ioo
EB>6T1oit0 = 80
= 524% 6>17 101802303 [20
= 74 Laorsey =R0
A= B>42 R17 102203 S24 Danrde: foe
= 3244 2214 lota0739 = 3547 10830 =30 -
Q= B47 9>17 10: 20) S>6 722048 >47 a4? 4o: 50260;//50
= 32428511 10220: 5562 B0:8>92 Svosoy
= B>47 812 (0120 4576230%50; = 324 Tasi} 10120150 = 3247102 B= 50 —
Be ALF OL UAL sar 801401 //20 =
= OPI PRO BOS 40; = IT AOL403 HRDXe WAP accept ano: find oud the given no.is 4!) Ye havo! —~—-——
Meant?
Tota;
PF CNENIA the Valte 2";
S#C od", Sar,
(@>0)¢ pecl-eve"'; crum s &&n=47 1004 20033
k= Crum>s 2 (numzio? t001209)50)! “ :
s Ploo; Ns. ” OW = oe,
He inst nado ian ie "5 K5// Err, hvalug Rounred
: ann)
at K, num
©) Thvalsey on err, value yeaulved The Aebhside mut be
Main ¢ ) A vatable nota constowtno.
‘Int awioo;
lootts
Pe ciokd as [Jenor, Avolue veauived,
ey
WAP accept 4 nals Find the min-value?
unite a pigm accept snds ,Soxt the Beds 7
ascending or deacencling 7
IRAN 91
wet ch natogies
tos
Seals & 24639294Advantage & Ternary Opens -
As Bley Stok 15 possible to finish in Single Stmk,TETS ew Herible
Drawback-
A Lk coill Execute only single stmt 7b can't possible 1 Execute muliple Skmts
by Osing eanaty operons -
Tf t-
Syntart- 74 Coon) Rephcement by compiled.
ime tz | E Ceond)
: t-— > hor Single: strnis 2 opal.
Stmt 2; sink, ingle fT
3
sime 2;
Cond | stmt | stmt]
Tly]e
Flix v
*. Maint) ee Maine)
cork) oe 7
~~ Feeaen) 783329 Tn the aS case, the olp papaly displayed
Pe Right) pbc Righey: Jn the sP4 aye refs nota prop way at-olp ,
Pb wang’) PoC unong; FeYhtS season, we use the elsd keyword!
geehe; gechty;
4 Lo
A: Aleng ole!+ Righteourg,
** Theosa> , me. TFCSDD KIRAN :
MAN), TEC5>2; a
lees i ? pecta"yy
pecan: Picton: pecB;
PHete's ¥ 4
phelbty: Poe's; Boelte'ias
° Pee'e'2y poe’ play
Poet,
. dip:. ABCD. & noneed ar Replacements =
olp:- eeep
iuIf else ?-
Syptas:!
Senne cont) Replatement
stmt 4: 1#Coond)
4.
eee ‘ime 4;
Else
2
Ste 25,
ue
Syptaxe-
. Replacement
1# Ceond) fe CERa) fcond | ss ] Sa. | Se +
ee tT Jelal
y
te iin
‘Stmt2;
%
Sime:
stmé a:
Syntox 3: ,
es Replacement
if Ceond) Feed) — [ed [5s] Se[ sa [0]
Stmt 4 a t hMyalx
fle ia F |x
Stme2; else
Stn 3,
4
Simen;
WAP accept basic Saleh Emp. it the Sal>20000 deduct the tax Adve & else 152.
Feioclude
Hinclude
void maint ) KIRA
t
Float Salary 5 Now oe
lyse Santosh Technologies
Péc't enter the sas"): Cell: 9246392345
stcheloe", & salary,
T# (Salary 520000)
Tax = 30% bs/eoy
eke
Tans ISX BSI loo,
P#C® Tax calatatedl deals on baste. Salt qeuzb “s bax 1 bs}
guchoy; &.Muttple 12 =
sypten: Replacement
Tecendy FF Ceend
Stmt 45 stmt 4s multiple thal,
stmt 2; stmt 25
Else. 4
Sime 8; Else
St as — This is 0b 0. proper Woy, whenever mustdiple simi are
stmen: Stmta: Executing ables 1B cond” beimeehes abteh the cond.
compulscany to place ‘he stints within the baal
cond | si] Sz] sy [s+ | $9]
tT Iviy] x [ato
e XL x} wed vs
Syntax: - =
t#ccond) ‘ e
t cot
Sy L cond] 5s] 52] 85] 54 [50
at) T ux fe
sey
Fix vy a
Else
4
%;
a wARP accept poste sal- than Emp. Gf Sals (0,000. HRATS BS Yo. DA 20-/e
TA seo
Glse HEAR 20+, Dae ISH TAS /o+ on baste sol Caloulate the net
Sal. & cltaplay clearly the bogie sal. Hea, DAL TA.
Maine)
Hee bsat, hra, da ta. net
ehsero/
peel enter the bsal" Is
ec'olet", &psal:
Us Cbsal.> 9000)
ct
tha = 5% bsal/i99,
Da = 20% bsal /iqo:
Jax 15% bsal /100;
4
HORAN Sig
NOW Yerra
Santosh Technol
Cell; 92463923790
thas ax bsal |joo)
Pa = 1s% bsal /J00;
Ta = 10% bso /i00;
4
Nee bsalpHrat Data;
PFC" The ne sal AB, H¥0, Da, Ta 4h bsal Ts + YoPeloP off af ymetsal, Ha, 0a/Tad ;
gachey;,
k
¥ Maint)
chsert)s
2¢ ‘A'e'al)
pe cay;
else
pect"):
gechtr; OR A
b KIRAN SIR
~ Maine) NOW WITH :
Santosh Technolosi
tnka=lo: DAAAQIIAA
ell: 924539234
THa~o) c
PEC Hello", ay 5
Else
PEC" wd Hai") ad;
S204 ae oat
Meant)
d
7 Cpe C'nello"))
4 of:- ever
Asthe cond. is Sodtsfiedt bur thee is no stmt +o Execute ,S6,/7E yalse,an Error.
“To make -fo Exeoute,
Mozac ) Maint)
4 Nyello"))
TECpectnenoryp fae EC PECIHello'D)s
t
st
4 olP.- Helly
Let is valid bud-tt ts not Treating ay cond+ Shnt.XH Mone) #& Maint) % Maint)
2d d
ECD) > TEC L Pt cHellg'2D Chiset: wu)
pec’ Helles - Te; | 3 MInath Sit.
else ae "yes'ds e
PEC world") é
& ene Op Exxon,
% Maint) %& Mont) X Maing) %. Meind)
4 t d
FF (0); Heo; 140) td
Peclys'); Peclya"), ca bse;
pec'no!): Bs PRONG! = 4
5 ¥ ° & ojp:- Null
ee tN samt, RE Exe dP. No
Hercminin MEM, eens
He mean dtrdtiline reve 1% 19 poss bility Botthauk coviting a stmt we are placing
* te Else cond. ‘Empty Sime .
Ail 3 Meint? 3 Maint)
nea i eras :
anta=o: Pat ays 2, %,07
asio: Paebead elas .
tase? eee BF Can gohan) Bans
PEC" welcomeriod",ads a Se ae e
Else Ba oe, ae lofedd ole", B15
, a Load
PE Cloled Hello, pedletigt»
5 Bite Olp!- Qvid
olp:- oHello ae ay
ele:- HF .
KIRAN'SIR
ow wit
fh Tech
>
FE (me== you)
peor;
else
paetyerla 5
4
Dip Yes
Sante
Cells Se >
Tre as recuvieg
Tetumving no. TF the ndsate non n reckoning
Hac inthis pgm thts not only checktag the, novob- dedmat
psats As Hood & double-
tis alo checking the given no. ts xeuwning o7 Non. TeEKrig.
Wie Returitng ads ade theno's which never nda. wheneves
Tecurttng oe.18 occurring, the float & etouble neve Souatls
now 8s alwoys great than the Floot
nels then YR Oa,
38 Sats feofrN aC
Muattiple if Condition 2=
Syntaxt- 72 Ceondi)
t
hit ; F -Enthts mussiple 14 conditions every cond: cor)
Ay D: Chedk, either the and. 1s sattsHecl & not Sav
ste:
There #5 90 choice dr leavis Condi tie
F "won,
T Lit Cond a9:. Uw
sine;
t e
f
iF os )
nS
eg
Xx WAP accept 4.nd's tind cut the big numbe.
Maint)
int a,b.C,d, big 3
cae Ente the Value). sin
“ a hed adit ae, Bb ibe Rel); kiran |
iSong nologies
(& Cb> bu Santosh Tec
9) 2345
bigeb; Gell: 924639
TE Cc> big)
bigacs
iFC ds big)
big =at;
PEC By
I9St Not, bray.
geteho ; Ps
y coo!
% if else tf
Syntan:- rr )
t
Stns 5
5
else if Ccond 2s Stats;
q Stit {
Else
iF ccond3)
av
(pstmt 5% Wapaccept aches- find out the given chodts upper, lowed -digith
Maing)
¢
charch ;
clyserta;
pe center the char);
SRC esd", &ch);
Cch==65 Gh ch<="2')
pecielec 75, uppa cased Asch elsd", heh),
else Us C ch>= 94 && che= j22)
Pe Clolec rs lowes Cae ot Ascit eled", chicky!
ie :
Pe Clolo cis digit ot ascll hd", chich?;
ebe fr
peColoc t5 Special char ob Astt sed echich)
getehty;
4g,
Nested if Condition
Syntar:- [12 Ceendition)
Joy
#Leond)
alr
Sime Ls
* write a pigm accept marks th 3 Subijters
the gixde -fAthe Shidents.
Santos:
Cell: 92
spect chat?
1926 »A-% (upp Cose) Céo te 90)
RPG .A-3 Clower Case) CIF 10122)
3210 > digits (0-94) C485)
Ans aa-y Special Symbls C+—4 3.)
6-> 34 -> Non printablecha's & Cntal Keys,
S~ exc Space,
6228 + Graphic char's , ™ a)
F 0-455 ast chas's,
KIRAN SIR
Now WITH
fn Technole? =
46392349
«Find Duk “bal & cays display wptalds cisplou,
if avg>to—> giade "A" , avg >50-> sade “B', else crdinny
Po Thomy one Subledh os pfeil aioployay foil adegeny withow place, min,
Be malls, fA gach Subject
C Poot ye dogieat opeiadas)a0
Maint)
2
fot | sma ma rinty
Float avg ;
clyseveys
Pec enterthe masa s!3:
S#C™ ch eled shod", Brn dba, kms)
fot = mitms +mg:
Ovg= (float )+0tl3;
PRC! totals ofa ond Aug cleat lll, tot avg);
TC mae
Teoma sar)
t
¥# Cmg>35>
GR Cavg>@)
PEC pass--. GeapE a). KIRAN SIR
ee now WITH .
1% Cog >5e: S
oma Santosh Technologie
FC pass ~~ 4), 5
toe PASS --- @ RADE By, Cell: 9246392345
PEC oxctinany pan");
élse
PCY fai"! y
4
Else
pecYaaly:
getcht |;
4,
% WAP to Compute Electricity bill fh domestic & commerciad purpose with the fellowing
Node units — Radelunit. Extras ps Il. Savice chadge + RS- 0-06 /~ per unit powey,
o-5b bas
51-300 was fam - Subject to min de RS 20/— FA Single phaeamh 5d
tb} — 200 sar 7K 3 phaje.
200 45d
dy Commerctah purpose «
eee eee eubhas RS 20)— sevice charge 4 Rs -0-06)- Pr Unit Pouch
0-100 Bas
>I00 4-00 Subsed b min. ob RS 5r/—-HK Single. phase & RS-100)-
A 3 phoge. -Maine)
¢
‘nt Us ph;
Chas type:
Flood amt +
chsere; :
PECHnveE be Domestic. CDlay"):
PECIN ELE a. Commercial Cc]<) ),
PEC In Enter option sn):
St Clelec!) &typey;
Ye Ctypet= "Dae, types AB type L= “c'Uh type f= &!)
pec! TnvabiA typelta-
geteho;
Exit tors
clrsext),
PEC enter nov 6 units "Ds
SECM +bd", Bow; KIRAN a
1 S JOW WITH
PECMentth phage ¢1 a3) !!9/ Santosh Technologies
sf Cena, yh Cell: 9248392345
7 Cphi oi && phiza)
aren type!2
getnts;
Gres,
3.
TeCtypec='o {{ typez= a’)
2
Te Cnuc=m)
Amp = nur nars
Oe enue = 100)
mb m (spe (AT) Cn Osa) 2985) /
She Ur Cnuemaoa)
Crabs C50% AT) + CO% BET) + (Cnuasardxgear)
else, —
Ant = COKE AED + CHARS FCIOO% 3+9F) + CCnu~200) x 4-20);
00
pt > nUrd-0b 34£ Cphesi)
Qt
TP Cpewaed
ptraey
x
else
te Cptes>
Pe=307
Y Welemonthe Ena Ct)
else
TE Crp <= Io)
amt = nue3as:
Else
amt
loo% Sar (Cu ~100)%4-00)
Sl= 20-00;
PEE nUxo66)
Us Cpheei>
-RIRAN'SIR
2
PE Cpteno) NOW WITH
pk= 50; Santosh Technologies
% Cell: 9249392345
else
te Cpt
a
tlushall ¢2:
Austen wt ye Aftes, $Flush Csidin)
eacscaie | farsig | [otie
I
chatacters ore. te
ut a’.
Atinclude
Magne) Outpur:-
bea; Stow Mant gate
was: Entorthe Thtega value: 343-55
Pt Cente the. crntege values"); antuthe chaiact, £343
steed" | had, with fAughe):
PécKente the characte mba the Integes values 4 ~
tlughall co: // Hlush Csidind; enter chaiacke « hy
St Chie", sy, 44h, KIRAN SIR
PR Chobe oles aus9: Now WITH
geen,
Santosh Technolog
% Cell: 924
“% WAP A Shopkeeper allows a Commission forthe Sales
person,
Tom Sale amt Rate o-cmmen,
PO 10,000 win
>= leo k= 8Doo RS» 2000410014 snsale cmb tn excew thr QTD00
Month =< Joob0 sis
>> 10000
S0/+ Ute 10080 Es] adene,
Recept item | amnaunt ayomilp. tind wud the much ammisiren git 7b the
Soles pasen,Main¢ )
d
nt ame;
chod teem:
Hoot onsn:
chiscrea:
pt Cin tle 1-¢pu Cela":
PEC IMLELE &. monitA Crmlm)')-
PEC" eri the ttem"):
SEC soot, & item I:
#lushalle:
if (Stem t= “C && Them) = “oR 4 stem | ='M UB atem 1 =!)
n C'Invalid rte!) ;
gether:
Exie Cons
4 Cxtenes'¢ |} ttn == ct)
a8
FE Comt-< too00)
msn =o;
Else it Camt >= 10000 || anst-< 250051) nog
Cmen = amb © B/t001
eue
msn = Count 23000) * lofteo KIRAN SIR
% NOW WITH
Else ’ Sgntosh Technologies
Cell: 9246392345
L
iecrtan = Mat 3
‘rh Camb < 10000)
cmsn = oun * S/l00"
élse
cmSn = 10006 x S/ido + Came — (0000)% 6] loo -
5
%
peclsates pawn amsnis y +f +2 nso):
gate, 93
SSwitch, :-
Syntax:- Susitch Cinteger variable or integer Expression or chatacks varfable’)
a
Case. ‘integ&s or chadacte, constants Stmt(s?:
break ;
@Ie + Integer dA chadacks contort a. shntiD;
breaks
Cores Integer oy chatacte, constant 3+ ‘stmt(s)+
byeae
‘intege, or characte constant stmtcs):
break
debaulhs statement (59+
5
The switche) one moi. decision malting stmt inorda to Incwaie the potormance
chthe Sytem we we seitich() simi.
The suittht) & more flexible based onthe choice Some partiauar case will be Prete,
TH the chotce 1S not maiched then deboult stmt will be Executect
Evey cose will be Ends with break stmt.
Whenever -the compiles Yead the beak simt Tt ustll come cub dy the Settent)
“break! &“debautt" exe optional stnnis.
‘The deboult can be present tn ony ordes
The cones musk be “Integer “type a “chascies’ oe ads be “floating point’
The coe & sucht) chetce must be wath TTL ts not dy Te ash a
t nat matched , ¢
Valid Suttehe) & casey:- KIRAN SiR
Coye 100% suwtich(s) NOW WITH
Gove = 56: sustteh( choice) Santosh Te: Gade
coe of 3
cose a6: Coxe alt _
Coxe, 243445 3
toe ‘id > Sustich Cmax)
con ‘al: core “4! s 7
Tnvolid:.
cae, 34561 |] tloating pk not attouecl
tye ‘abe! % M move chamacters not ollaued
Gaye Nabe” + /[not alowed ,
Coy 83 Fy Gre 23+ —>/Meplirte not allowedPAA
case 316-4 2// comma nob, allowed tr aye, bub In Seitth TETS ablowed
cose 626 + // Not aUlouxe
Surteh(> // emphy not allowed
sSuotteh Carb) // “tw vediabley not attowedl»
€g:- Matnt)
{nt chotce >
cliseer:
PR CHnlelt MAIN MENU
PEC INVELE 100 police”);
PEC Init le los emeraeney")s
PECIMIEVE 103 enaviey');
PHc'Wn erty the chotce $!97
St Coed", &choice);
Switch Cehorce)
t
Coxe 100+ pt C Pouce’ KIRAN SiR
break; OW nnologies
Gse lop : pe cHAMBDLANCE'): cosh Tech 5
os oT 9246392345
cope 13S PPC engnIRY"D; Cells
break,
debault + PEC mong choice");
4
geteh>;
&
WAP Zinplement the arithmetic Operation using Switch :-
moinc )
an Ae me PEC In wrong poate");
cha op: geeho;
PPC Ent a&b values 2\n"), gy.
SHC shd sha’, Ba Bb;
PEC’ Entathe choice (4,1
flush Csidiny,
st Clee’, &op?y
Susitch Cop),
case '/'s pt Cdivision= pd", a/b)¢ break;
Core “a! t pp chaddition = +d", a+b); break;
ca “1: PEC'IN Subbaction = efi", ab): break:
Corey! + pectin Multiplication = sid" ab); breaie;WAP accept doy, month and year find ou & display the weer day.
Maint)
be ddim, yys
Aug ap-o:
pt Cent doynos"
SRC" ea" ec);
PEC” ents the month nods
S#tsIsa"-anm;
PEC ented the yeor
St Chaba Ry),
p= Cyy-1) % 366 + Cay) J43
Linstead oe (gy /4
deap = (eys-D/4 Ly9-1)iw + (yy-1)!400;
Switch Cmm),
JRAN SIR
santosh Technolosies
Cell? 9245392
cay 3 t Apt=25;
Core 2s dpe aie
care | 4 dptadty
4%
1E Gyrh4 azo &kmms2)
W to (yah 4m no Bhatt 90} wall yyel 440==6) 48 meno.)
dptts
sustteh Cpe)
me + Pe sunday’), break: -
Gaezz PRC! monday!» bveat»
cues: Prt” Tuadeys bray
cout t BRE annie"); braces
cote 5 PE C'Thussday); breate,
casei pt C-bidoys break
Coge yt PE CY Soadoy") > breap:
4 geleners 4ee
% WAP a company Ensures 0. 30> 28 follows
Dik age dr the person >25, the marital statu is maried & gende is male.
it 2g0 20, marital statu, unmanied , gende ta male,
~P it age >20, marital stot Urmanied , gende 18 female.
TR any one db criteria is Satistied helshe Eligible for the gob.
Noter= use # Else condition. (withaw logical operators).
Matat)
Tint age
ches slate, gen;
PEC Enis the age Ob peason'!):
Sted", Yager;
PF Ci magitad stosy Colm"):
#elahabie);
St Chae, & state)
fPlothabter,
PECK enter 9
Sh afee", gen);
V4 cage >=)
TPL state =m!)
eee KIRAN SIR
eles : Ww wiTH
if Creligivee 8 gooey, gantosh Technologies
y Cell: 9248392345
ele
é Czage>as)
4 Cstate=*u')
Fecgene )
fe ° Eligible fJob"):
Beit Cane)
4
PEC Eligitle. 48 pb)
4
else.
PE C'Not gligible és Job);
4
ue% WAP accept a. char. find cure given chad is vowels & not (using Susttch ).
Main()
zg
cheb ch»,
PFC'ents the cha.\n'y;
#tlushall L) 5
SEC oct deh):
Seach (ch)
iv
Cose‘a'+, Pec" rtis vont"; break:
Case’d ¢ pee zhis Vowel"): byeak +
Cae SPEC rts vont"), break;
Core “Speer is vowel”) byear:
core Ss pee" Tbis vowel"): break.
debautt spe C’abis nota Vow). >
< WAP display she op Wrethis, 12 a qs.
Zstdiosh> ; :
Shot |; Strobl;
Stmt 22 stmeta
‘ < label name >, Got < label name> ,
Stats:
+ Maint)
dL
clyseve)
Xt pC Goto):
got Ks.
getcht?
&
The olp Infinite times bakes place Ttisin unconditional uncontrolled stmt. re-docinlt hae
pow ob condition checking ,
* .
“To mate “this uncenditinal toto Covdittonal sime we “ub a Teanany Opctes,
*& Maint) R
t AN SI
a ae “en winnol ei)
SOW) Ea
osh
Xe ie Cieesd Santos ne 139234
‘ Cell: 92
PIC Gotan): CLF: get
Onn goto
ek, got.
gotox:, gots
X& got
geehea:,
k,
% WAP te disploy “the no. 1 fo 100.
Maint)
ine fe
Naturals i2CFL=300) gates
chad, 95
toh fatwal;s $ole: 116 tnt ret:
29 @ Ne Pats
natals i Ciz=10) 33 Nakdale i¢Cfe=iny
a) 4
PE Ca7) m6 PE Usted shad Ie,
Tes a Raney
PR Chl actin", $--) coe)
rs Jot nachwal ¢
goto pocwrol + 7 4 a
4 oy 4
getehtr
oe
% WAP accept a no.-ind tus the Sum do Series upto that no's & display the Sum,
Maint) maoint)
d d
tat num, Sumy int Tat, n,sum=o1
peclenhs theno."): P+ CMEnty the AL's
Séchbha", &numd, SE Chole een: 2
Natwal 2 1k Chum 220) Series % pecans >
4 (oy Sum suum 402
Suma They
Sum += pum: gots Seriers
Aum. - 4
goto nachsal » PEC Sum ae Sctig teh 424-~ ~ doled g hd”,
3 P, sum)
PEC" sum moet’) Sem) geiehtr; ms
4. ae
Conditional Control stmis?—
> Sniy Controls — Sih
i KARA Ss
acpihile() s+ now Wayne!
1 aleltgeetion s ne,
Syntax, inital gocon ; S ato 3392
cell®
>
Ds
GULu
Maint?
a*
tot ts
clsere>:
T=10;
while Ct>=1)
becuse’ ty
tetit/)
diene:
tae ORI ae ean CheSa mtn ey]
x WAP ied & display suuares & cubes fA | to Lo numbers,
Maint)
Gt Tet gny
cheesy KIRAN gy
while Ctz=10) Santog pW wira
het Colts 95.4°°Molog}
PE Cisauade 4 shad’, nxn) 924639559
net:
pe Chauber s -nad In! nxnend!
tes
Serene,
4
[Pe Clin Alember | sauares\t-ceuboes I'l),
\pe Chbad bad ohéd Int, 7, txt, THixtds
Lets
WAP accept ano. find the product ts -hoo no. witha using multiplication opal
Maal) \ a
pk Ci produc (ceca tba) Prod?
geichty ;
4
a ub, prod;
ckrsort);
PECNEnKA the 2 values :"),
St CIed spd 4, &a Ab):
Prod no,
ahi le (E> =1)
}
\
v i"
ange PRC" product nb 2nals led Meld = clad),
cube Pract)
t
Prod = prod tar;
bes
5% WAP accept a 0, display ye muipliedion table fe the Nlo-.
Maint?
Ink 9, P=4
ebserey,
PE ClEnks theno. AR mul” table"),
SE Chepalynd,
while Ciz=l0)
PEC MRS Aoted seledtn,T, NAD
ets
4
getthty;
a
WAP accept ands bluoth: 2n0- lis play aul mui™ table torn! terms .
‘Maint }
Tat m, Tana Ne
chryset)
che tease taped KIRAN SIR
SECM shad 5&1, M29: NOW WITH ;
Tony Santosh Technologies
while Cézah Cell: 9248392345
t
pany,
wahile Coy enna)
ne Gad teh =oha "nt, nal)
ner
ety
PRO in);
geen;
4,
% + Notd Maint}
Int Nh, Tez Ceo"
Assets
pect IM ents, the na)
SEChAN RO);
while Coen && Cén1)
a
Oe99 ¢
ik Cfes2> .
Pe Cleuen no's trom 1 to sid "s 71m);
if Cima
PE Cin odd nds rom Ltosted!", na:
Pe Chebd E705
Ta fey
ote) Even no, trom Le 16
Hs a 4 6 Fo
ott edd no: “tom Le 1p
5 PS F148
getchery,
3 WAP Te accept o.no- find ow the given no-is palindrome o* Nat?
Maint)
Thum, reveo, num) KIRAN SIR
Chrsexers, . NOW wiTH
pe Centu the nota): Santosh Technologi
SE Chea", Sra; Cell: 924629234
Mumt = num:
while Crum),
d
FeVe revo ENUMel 1D;
num /=10 7
iB Coum = rev)
PE t'nlo. ts palindsome!'y;
else
pe C'Wo- ts not padindwme"),
gaehtr,
g.
4 WAP Accept a no. & display the veverse utr that No-
Mota Aum /=10;
t 4 ‘
int num, xev=0, Pte" Reverse t «fed "rev);
PEC" Ent the No.1)» giro:
SECS", Qnuero) ‘
while Guu? /} aumrs A num jad
t
Yev = eVHto rt Cnums|sio)” uAP accept ano. find cut the given 0-15 Armstwrg Alumnbet «
4
we ISS = (Baste sPo uss
‘Fk NuMamtco, cre 09 ',
PEC ents thenas):
Skcleled", Brum);
Og enum:
uphile Creu)
d
Cube = niume|-to:
ams = Gms4Ceube xctube xcurhe);
num j=to,
4
pee In Ahi shong oor thenlock lod 4, 09 ,amg),
geteht;
4
Hwa Pecepta no. find oud the factors ob that no. , display the factors. bole
Fired cat “the given no. 18 prime ov Composite nds:
Magnt >
qd . oe
Yn num, halls, cheek , Prise y Cpimes
a
Thktels pe Chand 1D
aahile CTZ=10) Pes
PEC at) -
Tees
Ges 11 pp infinity -
Ale thistime the Compile, makes teplatem ent sith bodes bud within ‘he badly
Gnly one Sime take place.
+ Maing)
a
nt T=0;
while Ct++ 210)
PE Che Det 2345678410
With Semicslon ¢;)
whenever Wedebine the simé ustth Semicolan , the. Com piles replace with Empty boy
es thae is no sims.
Main)
d int 121;
tahtle, Case; a
+ PE Cbd”, 1); PE Chea ty
"PL
Replacement:
while. Ci<=10)
— 5 No stmt, 26 0/0 intinty'
* = Maint)
a
ant a=55
hile Ca)
5 Hoel
PE Cebsa" a);
a=a-);
De! 5432190
4
PE ChB otto)’
% Maing )
a
nt ab:
clysexe3:
O=b=l;
while @)
a> besa:
babu;
PE Cbd sted ab)
te Cin dled sed", a410, b40):
+ Oe 12 13 uy os
tes
% . Maine) Rel ;
a
Pied hile (abe!)
elvserey; 4
an; tohile at+e=2)
while Cate) t
ahle Gtieen: 9
PrcMbaad; pe chan)
+ we:
% maine) Replatement:
4 chile Catte=t)
tn ast; Q
clysereys wohile Capte=2)
while, Catteni) Sota ia):
tohile Covte=n)
PROM dar; 4
: apr- 3
%&. Maint)
i
ink abs
elise;
a=be!:
while Ca)
a= bt <3
PRM aled she “beau?
Pe in shedata A410, 5407;
; Dips. 12 13 ty as
10 1s-
+ Maine) .
t Replacement
tkas ete
chsert7; 7
a=s; PE Cheteal ay
while Ca--) 4
PECK" a) peeled atte)
PRMepod atte),
% 2
St A104
ea eee Replacement -
: while (a++¢=3)
Tatar “
elesent >; PRC Yard 4a);
cahile Catee=3) t
PF Chel" a9; Pb Coed J anior,
PRCed" ation;
4 Ol 2 8 4 Ig
Replacement:
vein) eee 7
fata; a
qhsore; eWile @-~->=16)
a=; i
while (a~~ >=1) t a
cohtleCa~~ s=1077 pectha, ays
PRcMeld! ay. 7
ye 5
ie. 3wL % etd mate Replacements. — @-Notdmasn ——
en a
int a; wohl Ca Intasl; While cat+>=1)
clvsent>; lee wohile Cases an. a
ast; Mgt , Nehealha:
while Cae=0 ones tants fceeeae PRCA;
Te Cach2) alse { &
PR Cele" aed acer +a) Ae a6
he ¥
PE Cold" 44)
F CKojeat
Pe Chea ater, PR CYohed", tio)
4 oe a
23
Noid Maint) Replacement .
has art he a)
Oyscr0); 4
while Ca~-); PEC od a7;
PEC sled'5a;
5 ole:, —1
IAP accept2 gis ay base & Exponent find the power batue S& the beye.
Csimiler te pod. 2 av's).
. KIRAN SIR
Maan) now With ogies
nnologies
‘int bare, €4p0, P=! santosh 145392345
PP Clenta the, baye® Exponent"): Cell: 92
SP Cloled sleet", & boye , LE KPO?!
wohile. CExpo)
a
PV= pux baye,
Expo--:
3 M,
PE Cm The power values clad”, py);
gecho:
Bu
WAP TP atcept ano find the Some otha relsuntil that no: beome Single digit.
Matar)
int num, Sumso;
PE Cente the number");
SEC" ata”, & rum)
Avop: while. Crum)9336
Sum = Suu + Chum sfe 109; a
num /=10;
4
if Coigeot Sum )==1)
Break) :~
“The Brake) 1s an unconditionah controlled stmt .
The Breakt) will be used in suaitcht) & tase the loop only ,
The Breakt) “cas't be used only tn “i¢’ Condition”
wher the compile, Years the break simb 7 mmectiately Come muh ob the loop.
-~%- Maint?
=
shite Ceond)
4 ir
veCfond)
beth, fF
eee
Il end lop
* ie maine)
A Moinc) Tne 3
d fey
int T21 ae Ciezand
while Ct4=10) Se Caja
4 . ie Cros
MB Ctra) Ms was break;
brea ood eee
pHCioled¥s 1) s 4 ole BY
tet: }
Pe Cea r+);
‘)+ Noid Maine)
tnt ty
Tea,
while Cre=20)
a
pe cled"si);
eee [tare
WB Cid=g>
brea;
Yee ¢
%X Void maine)
a
nk ts,
tat,
while Clem is°>
t
pe Chkd) 7)
1 cry ats) /[re CAf=1s)
beeat;
Tees
4
= 4
Continue (9 1-
% Uord matne? % Noid maint)
a.
doers Int ts,
Tas; Paty
THis; aan
while C7v=5) ie cie~1e)
' PE CMeleal", 1),
ieCIe 102 ae D
breaw; one
Pe tMelea", 1; on as
i &
4.
te)
vie 14 sa 1 Oe) S579
+ Noidmaine) Replacement .
Sees ese:
while Ci>=10)
nee
he Chapa’ 7) PE C%led" 7)
+) oe
Te 228.
y
i
Ever, , 4 brett should notte init,
The. confinuet) algo unconditional contol simi.
voheneved the Compiler vead the contiuie) Stmt- te Immediately ve ent inside,
“the loop
contmuec) can be used only inside the loop.
KIRA AN SiR
ATA
ah 7
gortosh pevere)
Cell? 92
“continue; .
eo a Coop érd.% WAP accept 10 no- find ew bigget no. the Gyrtition rot “te accept any St no's.
Main()
i
int 7, num big =0;
claser(7;
while Ci<=t0)
s Cems the no. thd! "577
S# Cloke, dnum)y
if (nwumzo)
te Cinlegedive ni'sare not allowed ">,
gerehey,
tonne
y
12 Coum >big)
big~ num;
Tat3
3 i teop
PRC Biggat t sed" by)
getcht;
4
2 Moin)
fink T2102
while. (re ioe?
a
foteey
1 Ctadoks 1266)
centinues
pe Meled 1)
Be 4 6g----- G0/62--- A109;
% WIA Madnty
Fats
TeaD:
while ¢ta2
a2
iG Cinge ah t260)
Confinune *
PR CobdI);
¥ yp.
y oe TO1G = 62 = --1 Reh
Maint)
a
the Taye
while Clez2o) &
2 keeeon
Rciva &@i | chectng
combnute ;
PR Cle F 25
Tabs
aeExt l)7-
u
iG
~ The €xtt() Stent maites youto come ouk Am the pgm,
motnt 5 Dorey
-
1 Ceond)
7 cceurbu,
xi 0),
a
3 Meet 8-979 r
for li=
Fl KIRAN SIR
sen © o., NOW WITH
tort Taito gation 3 edition 5 updation) Santosh Technologies
4 Cell: 9245392345
The $80) 1s also Entry control Looping stmb~
The 480) 15 more flexible when we compare eoith while C) leop.
The fC) will wtaks in Anti-~clockwise civecton.
Tn +00) Everything is optional rey we con write A stmt C55
Tn 4AC) we Con place any no. ds intHakigations, by Sepesating with onmg
any no-e- cona!s & apedation Stmis.
égt. Ph Ciat,G=13 tere, Jentos Tets Set)
The #80) Can alo con unite cothbody , without body & with SemscolonCs).
*®* Maint) Replacement. ©
chor (l=) 57210; PE Copsd", Pet):
4 f*
int Ts
AadCM=Ls 42105 ph Coad") 744);
getehty
:
gs Maine
ant RO, LK
chrsert oy
fort Ke 03,
dU x45 A
pacin Thevaluey ob Kr T-XUS doled nds 5993 FY
ORLKG
- vob yy
Aowp
Bre<55 Joo; HeKt2 9§--)% fo this TE is checking only last condrfion res §>0 efther any
pe it checks only last ones
% TF the loop ts unitten with conditions,
110° tb Conchtiong
fox C=05 5253 Keres joo: K=k42 4 5--)
Then, olp fs = O58)
242
433
+ Both conditions have tb sattsty.
Te tt ts wtth —|}cord-
for (K20, 1255 Kee IlJz03 K=Kt2 ,S--)
op: O51:
242.
3.5 PR Choled sed", arb))
eee oe 1218 14 o¢
PE CIM sd ted, 2410, b410+ es
Maint)
net
-foxt 33) * —srotasing the loop // titinite loop -
pt Cae" 192,
Tes
1 CT>B) —> checking the condition,
brea op. O12 3 us
: Replacement: ~
Matnt) Aoitarts artena, att)
Tot o=13
dor (atts atten Q3att) air cee —
tor larty atten ate) fase)
ares 3
pe Chhd',a; Pechlal a2; _
x
a Hsu ¢ ~
ogy 1 Chai is
omen> First constde, nos we Rows & no-etr columns
> Find wt -mitial &frnad values ob Rows d Columns
> Th this Major Point the coltmn condition _
~> The Column condition can be vantatle Ah fixed value
TP Fn GW above, 6. the coltumns refixed vale, Every row the calumn te
hen the concition 1s a vaatables
*
> Mami?
wt 52
fosCi=t 5 ie=45 ity)
d
dor Gals Sera site)
ph chee TDs
pe Cyn"):
4
%
0d of od
oo de
20 alan
Maine)
z
Ten SS
Fortizoyfe=z5 tte)
t
for (feos Sen 5544)
EC bed AVE LSD:
PECIB)
ether
4
5)
x
* 1
1
1
1
'
Mosc)
d
‘ink
Fortta 1; 1255144)
“TOP te Bottom
molenns —> tebt to Right
changing
'
'
1
'
pope
1
Marne?
& ow
cs
9
Tae hs:
Fos 1215 jeas itt)
¢
FovCfaty Jeass 544)
PR Chea" 5)
pec); SIR
goon Kee logis
4 tosh Technolo’
2a as San g746392349
234
23
2
7
a Geisde EPS IH)
2d PE Cebea" 55
For F= 15522 HH) | pecans
Saeed %. S38 loge:
Kens ctr P53 F>03 iD
pein); t .
getcho; for (Sols geet s J++)
4 PRY ated, 39
Pe chins* os
us 6
718 4 10
Maint)
Tak t5,K=13
ford fats feausrat)
a
CoB Se7 5 ret)
PEC DG Kets
PEC Int),
getho;
4
* !
p2
123
23 y
234s
Maint)
Tok 65,95
PF Cénie the Row values"! )>
SEC ola donde ’
fea 2 T+4) Row
Jens
while CS>79 / spacey
a
pec’ 495,
Jens
4
Fe Lely eats S44a/} col.
PR Cla, $ye
PEC nny
gether;
4.
* 432)
Bat
2)
5
Matne)
i
Weiss
for Cisus 905 7--)
d
for (S= Us §>0,j--)
PE Ca", 395,
Pc ntl,
Nofoe)
1
‘tnt ,.5,5in5
char ch = "Ie!
PFC" Enter the value «D+
SFC" sed" bon);
jeans TH)
Ss}
while (s<=33 ~ 12.) // space
t
pec;
Stts
fortSels Jest s S44 Heol sbinkirg
Text color (+34)
= estereay; G Bada cloms tools,
Cpr: Chae" chy
ptciintys —
ee
%
x hile weore adding colors to ofp we have te take ~~
the cpfey stmt.
4+ ofby textesloy(} fun. wereaulre the consolesh 5
heacten ile. 2
SDa0¢
a Bate) | Bee aity
for (Sal; Je5s See) | SF CT
pe Clin ol PEON,
pee'n'y; 4
*
for CS=1y Se2 5374)
|] ts1] S==1] Sox)
%
else
PReo%s
4
pein;
4)
* WAP fodisplay all axmstong nels upin
1000 nds.
Int ams=o: i, num;
ForCt=o3 72 =100037++)
aets
while C1)
4
Cube = To
ams = ams + (tube x tube xeurbe 2;
num /=10
ih Cazrangy && az 1000)
pe Cha", a)
getchers 4
3 Temiss tt)
*
pope
wwe wp
I
!
'
!
'
2
fox Cfaly T2555 144)
for Chatg Sens St)
T# ci>5)
Pe Chel! 395
else
PROM" 4D
PEC" In; \
sy
PEC enter the 002);
Sf Caled’, 2995
while Cte=y) /row
Kev;
while C k>=y-t41) /] debt col's
a
Pe Che", K7;
k
e (s=1jse= G-182 5 st) /Ispace
PEC):
Se yet '
while Cea) ngh> cols
4 er
PR Cbd,
S445
Saas KIRAN SIR
ect"): now WIT! a
Siete; Santosh Technolo
% Gell: 9240"4% WAP altsplay alll the ASCH cha's with a nds:
Maine)
fint is
char ch;
Ph c' ASCII Char... Nos");
Forci=0; 12 =268 5 T++)
t
chats
PE Cn ec. -- fed”, cht)
3
geteher;,
4
% wap accept adecimal no display theno-in binary format-
Maint)
Tht Aum:
Aorcte num yf >t 5 patie)
2
a= tha:
PE Candia) anes
4
Do Whiles—-
IntHodisation,
do
t
stm!
4
[ore apt;
F _
he dowhtle ts an &xIE Contwlled looping stmt tin
st TE Enby tnto the body,
reuse, at leash One time cthe stmt
And then tt Check the condt Hon.
Ik condition 16 satished ance again enters into the bodiy, thts proces
continues untill condition drssatisfied+
In dowhtle the while ¢) mgt have Semicolon,
Dohite com otto torte In 3 Ways,
~ with booty ,
~ tetthout body,
— with Semreslen,i caheneves the prgm 75 Teplactng abia the do body mustg Should exrst &
© potthin the body only one stmt will take place immediaicly bodly will close Gabta the
iS body a tahile Condition must €xist unith Semrcolon,
Maint) Replacement: ke Maint)
he Tato; ae nt Tal;
do , PCat IAS SI do
pe choles, ~-19; ; _ ate wohile Cr4++ 10
O--- 4 Octal bare ~>8
O---15 — Heradectmat base~>16 [0-95 10-ArW-B, 2-€ 18-0, 14-E, S-F.]
Geos) Brnary base ~> 2.
Maint)
beanies
clrsere3
pe clined ar [1%
pec“ineoay NS
pen =[ at0"a); lois
peciaextars ld
pecin -b#x/a7; I] oxD
peern eH2,ays / ord
pa Cn eb", a); /] ener, No stdmas ot binary,
gehen;
4
vedB® ox144 DO xadb Maryse
OF43
o124 ora2d Ox6es 6x zac
625 +Ox95b +Oxabe = ——__
CRORE Oy,
oxigdc Ox bac oxas6
org eueec
nae >, 3!
come oe ~3s a
sail
71am
4 —> 100
= F a> IN
510)
6 S000 i — By sy Tit
toi ah) oe os me 1
% > 1000 Poi es yim
4 — lool 2 a) > ass —> MNT)
10 -—» |olo ’
97 —> if 0000) > KIRAN SIR
nw NOW WITH .
thous trou Santosh Technologies
- 10110 lool Cell: 9245392345
ootor GN ret
loo! oOo8
Whengves O vars Ts declared it occupies some byts vb memeny,
for suppose chad ch; it couples 4 byte ob memory space an inter nally
allocated eit memmoy range ctr Oto & -I 40-126.
vfor Every pant oo dala we have bona codes wohich represented tn f6-bit fomad.
0000 0600 0000 o000 —>o
Ob Let Vet Vita ~ > 32967
1000 0000 0000 0000 ~s ~326g
PUPt chap thay thd sey
we com FaBilY can Extract the ‘reverse combination & also the binary fomat.
O Feverse combination <1
’ “ " 2,
woe " = 1
53
A> 0000 0000 G000 0100
“BD wie Ub may fore
100% 94. -> 0000 0000 Ono OO!
~1OD HI VIL Toot 100onl wi mu nnn
0000 0000 0000 ocd!
1000 0000 000 0000 =-32168
K+ 326141
% -Z27168=1 1000 0000 0000 o000
0000 0000 0000 000!
Olll bit thal (10) = 82167
32168 +1 1000 0000 0000 0000
Wt vant den tay
om Wit ttt Ly = B26F
X= Meant)
ad obte ob oles Ayan):
lpi), B5B6. 32167, OAR
By this binary tomar ts Some bux Extenally the no's ade diHerent.
4. Maint)
ero eA
unsigned 43
-for (uso; UP
pt (held ~~ ee ol O-== RNY UU)
we. gfpte 1 5585 TIT FFE
* Maine) : ’ . R
a er Ft IRAN,
Fak A210 + 1O+FOHO + O10! pow WE
a Chua so ganto®
% Maine) cell?
qd clysertyy
pee oe, eed", ~32768,~32 968)"
4. 7 .
Op 316g 4-1 yley Ieee sigeete 4 byts& te
Zo this Erample >
binary cede tn 34- bis Ts,
1200 0000 9000 9000
LULL UE TAL 1M 200 000 9.00? 8200.
be added
Dutto 6% nord's wt
Due to shu gbyky will occupy for the #1sé 16 bits & remaining [6~ TIS
7S substrhuting in place ob- th that no. eautvalence ‘to ~l+
gases rts tawing long
PEC aby ahh eh", —32768, 2168 --32568)5
aa
OP- 22468 y-1, ». This comes in octal AAmat -c Bitwise Opsatns:-
a The Brhatse opetors will be used @n order-to Mantpulate the brs & tor dtgral
‘processing, -flip flops.
oralhnis purpose we use boise opaators
t+ 4's Complernent Re lebtshite Be Right shift
A; Bitwts: AND 5 Brhwise Eluaheor —g._BrhuTSe OR,
2's Complement:- BAW opactos never Work wth Hoating Ayre. datarhe.
or Encryption & decyption 4's complement will be used +
TES nothing bur Reverse Combtnatien,
Egi- Matnl? x ~O>-)
elvsevt: Se eeeeres!
PE Chea", 52: //-5 4% peclapd", 32768); //-a2769.
gatchl>;
&
lebt shift (2<):-
0000 c000 Gos0 Op! >
Bee} 5%! 0000 000 0000 Iolo > 16
5222, Sx 6000 0000 OOOH 0100 > Io
<< OK — 0900 0000 0010 1000 —> 40
<24 5x4 — 0000 0000 O101 0000 —> BO
5 I6o KIRAN SIR
2 Wy WITH
<2 ® — Ge00 C000 C010 LL oY ie:
oo > M4 Santosh Technelogies
Right Shift (>>9:— rf 345
: G000" o000 6001 0100 > 20 Cell: 9246392
aor} 0000 000 CODD [01D -» LO on!
Bomrr 000 000 0000 Dlo| > F raat
02> 0000 0000 0000 OID > » aoxsé
R0>>4 0000 0000 6000 000! > 1 aoxdd
Ro 25 0000 0000 0000 00> g — aoyat
3 >>2 0000 0009 0000 000! —» | tx
X =1>>1Any no. I6-Hmes w-~ 00 1000-8 x 1010
BelO > © s y -Moo
Blio —> 0----0 Iolo =I0 paeie
BAIO —y W----00 0019 =2 gy 1100
* Multiplication wtthout using arithmetic Operators: —
éstellooh>
Marat)
ta eubyesutts
PE Cn Enturthe andes: KIRAN SIR
SE Cold ofa, babyy
rrexudt=o
while Cb =0)
Yechued
result = result tay
Geen\) ynd' byt.
booty sate byte
PEC IN Reyults old “negult);
cr
ae NO
Oryor
“E WAP accept a no. Hind pur the given no. 18 Even or edd,
Maint)
fat num, y 5
pec ento the ng)
Stet sha" knurn KIRAN SIR
Y=num<Oq
b0D0 0200 0000 1010 =10
YOIs 1980 +Cdose ȴq)Extracting @ month:-
le Fhist lebt shit F timex cto clear the year.
& Then Right shte by 12 He +p caldatore the month
2
0001 6100 O16 too) = <2
001) O106 Lpom daSO poe
0600 0000 C000 Cell 3
month » Cdate <<+#2>>12
Extracting a day: -
day = Cdotecil ) >>I)
€9:- 04108 }2014
ore = 512% C2014 —-tAto? +52%3 +4
= 14908
(13 = colo 0016 011 00100
Ol000 Looo!leo10e >>>
yea =
olo0010 ~34
Year = tagot Cdote >>q)
month = ©10001 000 1100106 <<
OdI1 BOLD 6800906 SHR
0000 0000 0000 Col} —>3 Cmenth)
month = Cdate <24>>12
doy = 1000 tooo 11 ol00 >I)
2060 00000000 0100 — 4 CAess)
day = (date ai) >>1)
KIRAN SIR
NOW wit
Santosh Technologies
Cell: 9246392345Functions
A -fun- 1s an selr debined block Tt poborms predebined bash
Furls tM c-tang. axe clastified tr, -tuia Cakegeories +
}+ pre debined functions C library functtons):-
Defined by the Compiler
Sgt printtO), stanir6d, Clrscrer, getche)
2+ Use debined functons:.
Debined by the use, &9:- Maine)
% Why Maine) ts called used debined function ?
(we debining “the Fanclfonaliie, is the moine) og fey the Use, -ver's coe
providing “he -functionaliti@ forthe maint) page, this furl SiN fer the ey can be
change as per the user.
Tis 5 one -veagon ushy main() ts cated og user debined function
AS Wirt. Exery opeaddt returns the vote. Similarly the. furs odso etcens
© Value but ecieving the value is optional.
By debault every fun. vetum type 1s Tatege.
Tres vetuun type can be changes , if it 15 an uses debined function,
Flood Marni)
i, Cobal, Sigects Cmatny) :
gech0);
4 4 bytes,
Due to tits -resttn alag we aan call the main is an ase deine function
The Retantype & mainé) an be changes per use) rearivement.
& What is the necessary to debine ‘the. “Yetum type’ forthe Maint)
we can alto ste a value fora fun.
cohen we ave not verhnining @ vale it vars a Wasning " The fun. should
Retin a value’,
TO overcome TRIS Warning, There are g wags
Je Kill the tattuve oo the fun.
a Retwn volte ty the fun,
To Hill the nachere c& the function we have void data type
Maid :- eid is a data type cohich Hilly the natute ots the fun.
Note Mate) el Im by deaut
one ‘rehearse nde
a}
OgNotd Maint)
ee 0, | Smad. te ts not possible fo return 2 valiie,
geehor;
4
Alay, Do not will the Nlatuve,
s
Fane wath arg, novehen type Fa; - gotonye),
3+ fans with arg, ustth retum types Sai- peer, S#C>.
4+ tun. usith nooag: ,ustth vetun-type Fq:- getehor
1+ Function With No argument, alo return Yatue s-
Void printline Cvotd)s
Void ayacds if) eecaaton
Int mazne )
t
clrsove
Pantline C2; /| cables
PR CZt 18.0 fun. oriented \n!);
7ya0ds // calles
PE C" Back tp matnty Wi):
PrntlineQd: /eaties
getehO
yeluno:
i KIRAN SIR
‘ ; wit +
ad printline () JJeatlee gantosh Technologies
int t
6 345
Ad Chat; tea4go; iets PECL; Gell; CSE
Pe Cyn:
4
ae yao If caller
PE CXb 15 Sub module \ntd,
4
Tt isa -fun. Oviented +
Tt ts Sub module,
By using ars we can find the modularity dr the pram.
De bugging ‘> the pgm is Easy to Implement -
The. Major adv: T& provides Source. code reusability,
Basimatty the pgm Execution alwoys 4m Mazn(s Compilation Am “Topte Botton.O Tet A Ted
nk modncy votd x43 () //catlee
cheer u chat is sub module [n'13,
29802 ; Holle, 4
gern; Int maratd
return o: a
: drsere>;
Void 1ya0 //eattee mye:
gehen;
pe CIEts Submodite \a) 2, vetunn 0;
% &
Tt yolses an Enoy state. compilation
happen bebore, bebo the compilation
tt doesalt tind the declaration tb that
calles.
Thdoadlt ralsrany enoy bebe Execxtion
only the Compiler ahready Knows the det"
the fun. 80,34 deanlt atses any Enos
Note: clrsevey:— I+ Clea the Seven
&. Makes cursor 4% Roto 2 AStcaltmn
J Tests Ate
void 14309; /declaxaten Noid +yat>s /fdeclatotion
Marn() Matac)
ne a
AYR; [alles ayy,
ts yekon o;
meyac) /[ callee
&
4 Vota ayalr //eotter
pe C Helle; ieee
5 pe cluello"):
“ie declaation go the cables re-kivn eae
Aype te net Masching Thee ts no Evers, weade me veknnIng any
ie Vale, we are veburning only control.
Void printiine C9: /idectorodion
N SIR
Maint 3 KIRM wit eS
ae santosh Technoloate _
printing 015 /] caller e ie 9249392349
xehun 0; aiid
s
iA. printti
votd pitntline Cp }} caltee sh rafsy an Ener de uncebined Symbs) (19. To echich
t
Fd Cleos [e102 f+) module we ade Using the veatable In-he Same medicte
PECL ID the yoriable has te dedae. ?
5 Chae T stope nots tm Mat Orly) 2Example On cliserty;-
Noid chrysexe)5 /Idecloxation
Mago)
tin
pe Ctelloln");
clyseveys /I calles,
gether;
wekun 0;
3
Noid desert 9] cablee
a
fat 1.55,
For Clays t<=805 i4+b)
e Gatgdenworgaa, pect"):
om )
al. wow
ca. With Argument & Noo veturn value ¢
cn thts categeory “Theve 15 a comm. “Brom the. cabler “tothe catlee
but thee 7s 20 comm 4m Gallee to the Calley
FE WAP accept & nole & Implement the Swapping lngic-
Void swap Cin tnt) 5 /declosation
Maint)
tnt aso
chserey: RAN siz
pe Clenta the value Kir wire '
SR Chpadetd", &a2b); tosh Te chorea
Eee Sgells 0240397
9 :
&
Void Swap Cint 4, taty) /) calle
Meylertey:
pt CAbta Bvaping", x2 elo ys ofat "204
8
X Find put given no. #s Even oy odd.
Void check Cintd; //declrotion
Mainc>
it
tnta;
chisedt 22pt Cems the nme’):
sf Cod fad:
check Cad; /cobley
gecht y,
4
Votd check Cint x)/] eee
4
inky;
1£ (X+ha ==0) FEC (nli)=s0) | Y= Ne if (num>= 1D 200000)
maine)
iL t=num /10000000 5
Fok +xtClong)s // declaration if Ct= 100000)
z
‘= nam/ l00000'5
ie (tesr0)
exe ct), Meallea &
Else
4
€x& CHN10% 1025 /|catlers
ae Ct 022 I catlo
‘txt Clooocs?: |) eatlery
&
Dum = ou +f 100000»
TE Churn >= Jo00)
du
= num) i900;
Vf (te=20)
txe Ctr: [Jools
Else
4
tak Ctlo% 10); [calla io
tee Ctl 107; /[ calla
&
Ext Clo); |] eater
5
Tum =numls (900;
TE Chum >= too)
tL
seat Com /1007; /Loier3,
Ext C00) 5 J eaUer 14.
si
um = nur! 100
iB Crume= 20)
txE (num); |) calle, 15>
she
a (Cnumlio 10): /Jadles |¢
txt Coumpinn; Mf cable.
s
geacho,
4
txt Clog num’) // tans declatosion
Suattch (num)
1
Case, It pf CXone4); breaks
aear prc Tusl2, break:
cose at pe Three), break;
Case A> pt C\four"); breale;
Gre 5: PE CFivel); beak;
@e 6: pec sixty, break;
Coe +: Pt C*seven"); break;
Coes. pf Cetghtta: beak:
coreg. Pht mineld: break,
case ot pe CY Tent); break:
ase 202 PEC Twenty); break;
Coxe 30: PEC Thivty")s break;
ie 403 PEC four; break:
Cove BOs PEC FAY): break:
Cae 60% pt c"sixtyy, break:
Core 40: pt Clseventy!a; break:
Gre 80: pec” Eighty"); break;
Coxe 90. PEC ninty’), break:
Case 1007 P+ C\ Hundred); break:
Case too; PEC Thowtand"), brea;
Case 100600; pec Lakhty: break:
Case loooc000: pF CY Creve 4): break:
5
co
KIRAN SIR
NOW WITH logies
Santosh Technologle
Cell: 9246392345Fun. with Arg's & return types
Tn AHS Cotegeory come? takes glace. from “the booth sicteg, hes strom the
called, & tyomthe callees
WAP accept a no Find the factorial th thed number?
long Jack Cint); //dleclarasion
Maint)
nt num 5
long Ke
ph Cert the number“)?
SE Cbd" Erna;
Ke tack Cum, farttes
Pt C’factorial ot sled tste/d 9, num;
returns
getty;
bog face Cent nurn) Heater.
u
fong sets
titer oll numze)
netan ts
dor C 5 num >=25 S2sx Aum ~~)
nectar gs;
4
Addition
Jong, SamCiak stot I dectasotion
Masnt ?
ae
‘tnt arb» long $+
P+ Camas the ndse):
SRM ed lid Qa Ub:
S=Sem Cousds ffaabtes
pe Csum Bs 2 ads 4s
ehin O;
gund;
dong gum Cinta, ink y) f} cable
L tong 3s
Raxtyy
Jat, 39;
retan gs 4
a
etwuction] Address [ value
: ess0 | as:
oe geen | 8°
éssve
ess 13
essiq
aay esse u
i easte
sss | HOBO
5 emte
essi9
Subtraction:
= rtay ars
addition : ~ _
Be mmayelsCc
~
% WAP accept ano. & display ‘that no: In binary termat+
< math-h>
unsigned long dob ctnt>;
Magne)
Fata:
cleseren;
PP Centa the, dectmal nos":
Se chlea", Bn}
PEC Binary easlvalent «ls ber tor theclectme! no» sed In", tab (nd,
geteho; a4
“tetuvno;
y
Ansigned tong bin =o. p=0:
while cn)
ba = bin + Chmale2)% powocop))+
leas
Pe
3
“fetus bin;
4%
Function Colys-
A une catty 10 C~
te Coll by value Cdebautt)
long. will be take place 79 choo Woys.
2+ call by addres,
I Call ky Value:
sending the vale si: ads rn
Any, changes made in the fun-
caller 19 the caulee *s called Call by vabe.
it will not ebbect fo the caller Jun-var.
VOMMEL ©
sway
z
(000 be (a4b)-(a=b)
oo a
MK. void swap ctintyint)
for oues ps gantosh Technologies
Peed eed Bank) Cell: 9246392345
swoop Carb),
pectas sled & b# led abd;
getcho>;
Seid sumpCtat a, int b)
1 b= Gath) ~ (arb);
ie Chobte, gwopig arched o4 se aaib)yHe Chod Gy, C2, Os, Cus
ink hota ss fas
elo f-fe ris fee
Declaration cabling
int SumCTak tats ‘ny = Sum Chis);
lord. Sam Cink, THO; ~ Sam Civ star,
Ploak sum CPlood , foot: ys Sum Cf fs):
chor Barn Cchar ind F008): Gzsum Cea, 4)
Nod Anughal)* Anughatr>
Int Anusha Cv: Tie Anushat:
vord abot Cink, chad): abe Ch, c
Hood Anu (chat, int Flea Pym Arr CC fay f5)-
Float 5 7
Trying 40 reten move ‘than One value by using wehan Stetement
Calum 012614);
calsum C1042, 23d);
Calsum Cay colsum C2511014),a3: ff Slated fen. call, oh
Coksum Carrsidds we By oat
colium Car2sdd+23; he xine an
77 Reusing, Morethan A volue sart© a 08
Mone) cat
Int Q=10, b=20,C=305
tne SP:
SiP= Sumprod Carbic) ;/f Tnvalld lebt Side, ooly one. variable,
pt Ch sa gap
4
Sumprod Cint x, inky, int a)
t
‘nt Ss, PPS
88 AYERS
Pre= 2Myea: ~
retain C45, 99s Moot possible.
7
F Ove. Moe Try
‘Maint >
t
Tak a=10, b=20) C=80;
jok SPs
Se Sumprod Carbi0 sp= Sum prod Carbic):
pte Cinlecloteds 319%
4
Suro prock Cint x, tat Y, inta)
2d
‘int SSL PPS
SS=1t4tK,
PRo xy xa,
wetuyn 6552: // Reducount
veturn CPP
3
AH We only Way out
a
4
Matn()
Fok Q=10, b= 20,.C#3O7INS IP:
Sesumprod Carbiesi)s
un prod Cavbie 12)»
PF Cuid bid sp 25
4
Suraprod Cink, toty , intg ,7nt- code)
4
‘Int sspPs
SSx YAR, PPS TRYKA! sik
18 Ceode = =1) wee olosies
ae Se gent osh res 3923 49
YetuynC pp; cell: 92
bettes Way
“elu Coode==1 1 24Y48 2 1Ky gd >
Inwvolid «
Codes =1 3 return (atyta) t retunlaryaeg )-Recursion +
Pic’ Hello!)s
to 3
= ePoingeyn-
ny
abe ¢)
4
pect:
ac)
u
abe);
Maint)
4
YR);
The function which calls by ftselb ts called ax Recterston.
Recursion 1s one o& the beautiful proces whenever we doen't Know Some,
Partials corelition recursion wsill be tmplementeat«
c:\ D\ BN
AM
Bap
&) fa
* WAP Addition tb two nds Osing Recursion :—
1 int Sum Cink, tat?
2 Maint
ad
4 Inbar;
SPEC ents the. values 5
6 Stel ehdiled Bar Br,
1 PR'Sum ay too nds lsc) tr", sumCauby):
& gers,
94
Ip ink Sum Cota, ant b)
wed
i Te Cassod
we Teban bs
ty élse
1g Sum C=O +b);
te &
wind
proces,
or
Runtime stacts“The internal descipline, ob vecurston will be tae place on siack proce#s,
Te ts cabled as Runtime Stack.
Ary nomot fun+ will algo works on similar way o& Recursion
Fun+ €xecettion will be taxes place baed on cpu 05)
The drawback o& the funs when mare ne: dtr fins cally ave Tneveaying , the
pebormance ot the. syptem util he degrade
The eal me app" or a recursion.
Stayt > Seach > Files H Folders.
when Recursion Examples, tenplementing solve the prgms with Une nds-
i Noid ree Cint i?
tu
peciin
re Ciena?
ste CrH2
%
Not maine)
sored cune
yee;
4 Noid rec Gint
ane
3 peC eka,
4 5F Ctez2p
Ss wee CTH)
c
+
&
4
PEC na S75 12332)
&
Votd mainc)
2
te ecco;
Hy
Diftevences between iterations and Yectirston :-
S> Tt is a procey & Exccation a Smt oF set wy simt repeatedly untill Specified
condition «
& Recursion 7s the techniaue chr deining anything Yn terns vo Teelb~
Ip Tteations ‘invelvy our clea\ steps initiafigation , condition, exeorton&
Updation .
&> ‘hae must be an tnclude if stmt inside. the recension tunction specifying
Stoping, Conctition .
a> flny Recursive prblm con be Solve Teacrtively,
R> Not ald the prblms have Recursive Svlutions.I> Tkerative counts post dra piblm is move ebb cient jn terms ob memory,
fnitialigasion & Bxecution Speed
R > Recuxsion ts generally caorst option 40 90-4 Simple pigms ane pielos not
Fecursive mM nature «
SEINAP all the yecunston slow down He petormance os the Shy,
long Fibo Ctnt>;
Maint)
Tne os,
PP ChEntes the. row sige ">,
SECM a", Ber,
fortne6s nev; net)
PE Chl yn", Fo on);
geht,
4
long int Abo Cintnty ot as
05
ees WONG
wae g2
iF ¢n==0) yo 49 9,
fibro; so gr
élse iv
te Cn==1>
tib=1;
&lse
ftb= ftbotn~1) + fibocn-22;,
seturn by
)
Suppse 955;
long 4bot
Memory Oxgani gation +
Structure dr Memory Helvarchy :~
1
foe
Lowers] Cet YY
Basteally three, temporary memory areas Reg's. RAM and Cache Memory,
Dale. uotll be store in RAM aren ag we consider RAM avea there are hee.
Parts avallable tm the RAM axed.
Our data. will be takes place, usually in the RAM process
Tt com be state RAM oy dynamic RAM.
Whak 1s RAM memeng ?
The Entire RAM hay devided in novot eeuck parts which are Known ay
“Memory cells’
Bastaally & RAM contains diff: types & areax cif. parts cr data athe
C-prgm ts loaded in the Memory,
Every diff. types th variables is located’ tn ditt. locations.
oe KIRAN SIR
NOW WITH :
Santosh Technologies
Cell: 9243392345
uninifaliged data
Inittalaged dota
‘TnsbuctionAN Sik
logicas \R
LL i pone E wom wan tosis
EAD new santos? 94939 oe
|_— State uninitiatiged Cell:
pss. | State /global geo
[— global uninitiatiad
J—— global tnitialized non sero
Constant
As pa the Org” in diffs partt data will be Stove & diffe initialization will be
taker place.
The RAM contains Gach cell, Ean store d byte sb data, data will be Stored
in binary Format, the chat. data resewes one byte ob memory Space Flooding
Pont Ge data wail Yesewe 4 memoy cell, gach memoy ce bes untaue acks-
Adis ts abide an 499 orter ir Hexadecimal formats eutth combination ay
Ttegeys+
for Suppose, int a=45
Tn 4hiS, Vaxtable Stoves in the memory in the -follocsing way
Q0000100 | 0000 0000
$000 2
Actual btnony bis for 4
2000 cca 2009 0100
Higher memory Law mernons
Bub ta the Memo storage vst louie memery 1S steving Ee then highs Mery
Stores.
Stnce. te ts unde, the concept ote * Little Enctlan” (concept tr Stoving lower byte JH
Higha Memon).
Little Endianz- Th whfch intel procestors ustll arrange
TE dota is sired fist high, byte & then lower bytes then that Ts
Big enatan'.
agi Motrola. processors Cbg Endion),
In ‘this Memory adns hy the 45t cell Oxsv00 then next memay ads
OXSOO1 Stee Tnteged dasa alimys Stoves In coninous, memory Location ag
we Know EVey adss alway ta 11°F order.
What ts an Restdent Memory ?
RAM 1s deutded Imo a pats
le &¥tended Memeny Cuselas’).
Re Resident Memory.T_T €
3
4
4
:
fl
7
—_—
E tH [§) *
Z
MB} Diy
B|
—}— N
> £ T
Tn TURBOC 3+0 the compile, sige ob Resident memory is IMB.
When any Pigm ts Executed Tete Stove In Resident Memory to TORBOC Bra,
Te hay 1M@ vertdenk memory which sie tn the RAM when we open TORBOC.
physical Adxess Oe the Computer: -
All the C-vosls are Stored tn the Resident Mermony 10 TUR BOC 30, 26 bids
adys do the rmemeny cell ts known ag “phigtoal addreys". 2 “Real adatress”.
Tn 20 bits we cum represent the address from ox0000 to OXFFER - fee
all c-voniable, must have. the Memory ads within this range.
A Copgmy Can't decide what will be the memory advs. refs clectded
i comet KIRAN SIR
Matnc ) NOW WITH
oe Santosh Technologies
Hk Cee) ten; Cell: 9246392345
yeton 0;
4
we cadt predict bus we can see tn [6-bit compilers achs mustbe ctthtn
OX0000 “fo OKFFFF.
“Tn Bz bis Compilers 6x00000000 “o OXFFFFFFER
Suppose Your C- compiler based on the Miceproceyoy total.
Then 7 od oF .
it oto sige t Yhe oddreyable Memory, eee
Addvesable Memory . ,{trsbiy) but 1024 byt = 1 KB
124 KBs Mg
2
“oS bys 4 OB
2 7 Is2aCiorestece nor MB e1 GR.Memory Segments > -
Resident Memory ob RAM vb sige 1MB ic divided into 16 eaual parts «
3 parts ts called “segment”.
Bach Segment sige 15 64KB 7 1EX64KB = leUKB= IME,
7 ask adrs _
mee onrere
° oRReee
OF PO°8 eBSIAE Bach SoyMont
v ore
2 aie
a Rite
1 oxooee
WR
This. procen do division ts called Seamentesion , Kanan S) oe
: wow WT oyories
Whak 6 an dbbscd addveys? ec? 349
nit
anton 28627
Se
carrer Ahisek Adetrers,
S01 in other wordg we am say that “re. Memon dss in c hey B pants, Segment
numba, & dbbteh adys.
Suppose. physical adrs ds any vin. 4% C is OK SOR then Segmend Aumbeh Ts
and dite adrs ts ooFl.
* Maan()
L
int KS
clasewers
PRC Ro: site aes
PE ha mptar: 7 Segment ads Oe: 65624
ph Cin emp! @ays // sitet adres in dlewncleetmal . SFBB
geehe, - Ree
4
Dato, Segment in C 1
All the Segments ave used Hh specie. purpose LiKe Segment Novis Ts
used tyr ROM + Is+ROM 14> BYOS, 3—>» dada Segment -- Et,
Segmenh nor® ushith ts Spectol name , Known ag data Segment, This
Segment #8 devided twto major ~four paris. Thus Representation weabready
Mentioned ty below diagtam -
OudOXF
oe
on,
oxe
ond
Oxt
Ox
xe
oxy
oxs
one
ont
oxo
Te Segments ir Residence meme
GARE Cem)
CARB CBIS)
axe
GARB CText video
CARE (Graphics Video Mumany )
GARB
£46
CARB
ik
J __S4 hbo
£4 ke
64 EB
54K
ean Ea
Cell: 9246392345
The Major areas Code dvea, Data “ivea, Heapven & Stack Area,
High Memoy ates
‘System
env
avev
c
Ardovaniable tor Moto)
& Maine) trame pointe, CEE?)
[ Hetio Vontable or fun) aston pC ita te
meq te Seg
coe Bites ee erie
‘Available te mpmouth |e en
| Heap Cmattoc 0, catloe Opneww)
goa | Glbal vansabicy rntnllged ate ~ BSS
Tot wz (007 Sitiatiged data — data
om | Malioc-o Ciib*say Ubtony unre Stacy inked —not
Pinteso Clib*.a) ‘the unalone
wet gett | tile .o
on Maine 0
| funce
Stove Cstastup routine)
[eben autre ae
(a Manon ads
J The Return ales\+ CODE AREA:
The py Code Ts hae the Exetulabk, code available. -for the Exenrtion.
This -area algo known ag Text Segment & it is fixed sige,
. ome ae acces only by the uns pointers not by otha data pointers,
All the static & globak variables stored in data area, whas evel the data pr.
‘Jin the dota avea, Aroughouk the life time o& prgm will be takesplace.
Te Pala avea can be calledas pamanent memory adis.
wohaKNG the dada. pr fn the dala area there will be available throughout
the End oh the prgm,
Th this segment thee are 2 parts ote present. they are tnitiatiged & Non
Phitiangzed-
TE the. vars is initialized, to some values other than geto, they atlocated
with Snitakized, Segment «
taken vals urimtatiged they allocated uninitaliged segment.
when we want to van an Executable prgm the Os start a pIgm Knoud
4 “Mader’: when it loads the file into Memory it takes the BSS Segment &
Ynitialtged to gers,
“THis axea cam be choosed by the Sa leper on the Storage clones.
Basically thae ae 4 types ol Storage classes.
ls Auctomate storage clays KIRAN SIR
&. Stole Stoaga clan. Dany logizs
3+ Global C External) Storage clas Santosh peau ~ + xe
4+ Register storage. clay, Cell: 92433929
huge five types ds “ storage dan Specifiers".
te Auto a Statfe B+ EXtern, Ar Regist & 5. typeceb.
Memarylocation | ritfatvalue | scape ufe
Stack, ; ustthinthe body Enitive looky
Crengrdia a
lata. area catthin the
CN
AN the. Functions
data.area.
registen within the body
ac:What ts a Scope?
Scope vetbers tp where Tha pigm aq variable moy be accep,
fg:- Noid Sample?
1
att;
4
Votd masnt>
a
Fk ato;
Sample);
Somplety;
Sample 0
PEC «led;
a
This Scope can changes if the Storage clay, changes by Tk ts asetomasic
Storage clos.
ole!
Bra, since Scope os “ats
Pre only tn the Maint) module,
Meant) + Maing) e+ Maint)
Laat 7 ‘ .
we
‘Seope Inka: > Anangmous Scope.
: ‘content ©, steatten Spe ;
4 y 4
4
Exomple for lifei-
Life vebbes 40 tow long a variable Exist ov vetains its value
Magn¢)
: ‘ N SIR
meas [I4askod Scope. KIRAN |
Santosh Technolo
PEC eda» /f16 92343
a Cell: 92433
nt 6; /Jananymous scope
b=20:
atts My
bets Ma)
pe Cd",ars
PRC sled", wy; [2)
By
pe Osha" a9: MU
pt Coa! bo; [enor
43- STACK AREA +-
AML cutematic vastabla & constants are Stored into stack area,
Automaiic Vosiables & constants are
1s ALL the local ya's cb deboutt Storage clog
2 Vools dr stooge cows aiuto.
3- Tnteger constons , characta, constants, Sting constanig » floak constarlt
wo EFC Ta any. Expressions.
A> fun. porameters & fan. veliin value vais ta the stack area ale always
deleted cohen “the prgm contwlled teaches to the ‘ub scope.
Due +o this “stack areat" algo called ay Temporary memory area
Maine)
t
Tot T5 fl tun. Scope
shor Cle03 teas te) KIRAN SIR
Wow WITH
zt
Fnt a=5; /Liteotion So aoles'=
int a=5; /I fon Scope. santosh 1057392345
i Cra"; cell: 9
geehe,;
o
a TF ae
fos a | Once. bo close iteation Scope cot!)
dic Yewhen “i” yolue tncreaze Tt
Creates / Tniiadiges the Vaxtable +
stack
ana,
Heap =
cade. H
data. Sgment
Nastable 15 automate vantable storing in Stock
usithin the for loop So, abte Bach itaation vorable ‘ol is coil b
area, » Scope vebtable ‘el Ls
ye, deleted
from stack and tn Each iteration variable will initiolige.
a
Fat motat
d
fot ass, bee, C24, de 85
PROMLed ope otedl ds,
“Famas Speci Ration
return 05
i Oe 8 6
C
oOThe TURBO Comptiex anel basech
‘the derautt Storage clawes Tf all the vals ts auto, since TE TS aictomatic
Naas is Stored Th the Stack area, ob “the Memory .
xextwill store [8
Stack 4ollows the discipline LIFO Tr stack os > [3
FEN the PPL) Name dr the vals 15 Noh written explicitly So [<_|
tthe clebault lp contain di stack which will be tq LIFO =
orde. Fer 8 4 6, stack
Has 2 poate One RR Initialization vars & othe, one non-initialiged vary All
TniHaliged Vans are more nead than non Initialized variable.
* —
int main? in re
a wml consoled = ba
inkass, bile | a =
PE Cid od shed"); s | fev
retemno;
4, On. # S qv
Aucomatic Vols a&e aie initabiged & b ts not inifatiged .
crnittaliged van's are moe ne than uninitialized » Thay will be Stored
tn the Stack » due tp “LIFO" FLS- since “ol ts move near than b wrto ‘cl,
% Maind)
t
ink i
Hori=)s Te=105 t+)
PF Coed sted inl, Vfunciy); ae
gerchtr;
5 Her
fun Cini) oda
oe on
S=100" re
Stats
vehons; QP 101 Wr tH 104 Lor 106
% “ lot 10% 104 LO
fi ML initio, every me Scope will die) ,
Note! Ardomaiic vos EVEY irre. will initiotige ( every
Static :- KIRAN SIR
: — Now wits
8 for lite ee Santosh Techrclozies
ieee Cell: 9248392343
Stoic ‘int i>
PRC sed,
% lee “Qs dataiea, value wil begMaint) Stach
l aes
(Stat Oo)
StarO} pasa [Fd Only onetione creates ,
oe Se | [ea Fokinet Create aretha black Ukecuto
Stak)
i KIRAN SiR
State hk ar
Feed Santosh Technologies
oO Cell: 9245392345
Diff- blu Scope ot auto (non-static) and Static:
as Magnt )
a
nth
ctor Chon Fe5.5 F44)
a
Static tink as
For bee;
hd;
at OP: 1 t
PRL"In bs ond'bys oes Ps Stotfe vaiable Every time cofll not Initiatize
2) otha than geo, it hoy ty Tnitialige of the
return o; 3 ime ot declaration enuy.
Ke Motne
ye? stam) Weaur ete
nt Ts
or Crety te=los itt) heap
> C%sbed ele io", m:
PF Ce sha toy Fy tun cds Pa wiiebide rong raves
geeho; 4
% code
fun (int 1)
Oly yo) a tat
We. Int Set00- 2103 128
State Int s=100; coe | ote
Atay Stet; quo 4 Me
Nehan s: sys 815
tat. br
we. 7 coal
pane ink 70)
Int main’) Jor static numes, data et Ks
LF C75 1095705) tetern qum—-7
2 peed yous Y
cretun osa Extemal Stovage clays :-
c auto int i> 6 ynteger
*%&- Int is // global
Maoint)
Sito #7 loca
pt Sal 7):
4
; pagsone
Fh this local va & ghtal vals ave pr in the same adea, Aluioys prebelence
given to Yhe [ecal ‘rathe than global var- by thts renton, i# we want global
& locak Yolue aba time then
Change the nome vt the vaniables”
% inka; // debinition
maine)
ae Maine?
Extem wta;
a
pe Chaar, exten freq // cleclenation,
4 PE da;
29". Evy 5 op. o
Difference blw Decloration & Debinition?
Declaration :~ only give, the type , status & nature vos's eoithost vesaving
any space for the voniable.
Debinition:- Actual space is vYeseved tos the variables & Some. inital value
fs given . \
* tnt as //dedinition
Motnc)
Lu
extern mt azo; // declaration
prcteha" a)
GIP eri, Hee we Dall onign
Volus tovad. beog, it doen't have Metnany
Space
X- Fnt a=201
money
@yton ink ay
‘Toip to~localvad- acting
ay global variable +
x
func)
peceedlad;
5 op; 10 10
FH tntaz
maine)
on tnt a=to; //declatatio,,
az
PE Chtaad;
4 \
Opp: 10
KIRAN SIR
NOW WITH
Santosh Technolo
Cell: 92432392345x int a3 void tyac)
q
Nord
lord ayac ) Las,
+495 ¥y Cf
‘s ints
void Maint) Hoe abeo KIRAN SIR
N
a ; Pia Santosh Technologies
ia . Void maine) Cell: 9246392345
a bree;
aga;
4 Gps. evry compilation
Ami, Soot
3%. Void Anu wm pea 1s o0.it
L
Extern tnt y +
a TF 82. Loco. vatable 4 global.
%
fata: // debioition vith physical Memory .
Noid ya)
@® - void aver
tg, 5
8 nt Ay
Votd abe co staite tts:
449: de tass
& ee PEC nated ote", 15):
Void Maine J if (Lenz)
a abet);
+t9s/I PEC Insteetsta", his):
yates /1 2.
been 3 Nae Maine)
Anu eds //4 abee;
PH Meh") abe 0;
s y
% vintas
2 void abe 0;
aq
4 tnt abe
3 stotfe tat a7
SC ol=+tags
1 Ftgy
F PE Caled and ed alas, 93
9 it Cobesad
| babecy
DPE Cin sedendetd®s alyas sg):Is Nota anucy;
wid
Is tne ey
\ static tats:
tis tess
wotte: op:
5 OW!
14 PE Cinskd ebed «bed, DiSigo? Me
2 NiSig): 223
2 abec: 234
2 tt Ct<=2) ae
a2 Anus 234
BE PHU \nsbasich sled, sig?! pee
! as
wy Me
25 votd maintys ae
xe 336
ay Anul; af
ab, oot
abe Matnt > oe. Volk ange taba, Trt 6)
| . t
Stagtc Mt i=s~ PR Cin sled she S,arb2;
if CT) 3
L Votd Mains >
Maint):
5 fab t =i
Pe Cbd onan tty Mt?!
y aed tei) EAT:
PRM in end Fp
4
KIRAN SIR
NOW oe logies
Santosh Techno os" *
Coll: 9248392349POLNTERS
> address or
> Vale at address.
Cindivection opaator)
Cobseck at that locaton)
Maine)
t
Tnt a=io;,
PF Cvatue bas
PP CY Adis & @
PR CAS or at
PAC AdS oF a
ain't, ads MA Aa iy
a\n', ar, =X 6s32q x19 Ne
a = 10 Potntel not
Pin dar:
2 ole: eo ue
PE Cadis ob ay hd In', wa): //ervor. Wate ot ast .
PE Cvolie at sha" ¥har: Adis ot- at 6sszy
getche, Adys ob a #Ee4
4 nds OO. PERE
i . value Oba t 10
ote? The value at ads Symbol tadivectty or divectly oorks withadys onty
Debimtion:- “A pty fs an deatvel dota type which can hold ads!’ e
The ads can be ordinany vos, array vai, Use debined datatype iat, 8
Any other ply var.
“Et cam also holds adys te a fune
Syntart- — aratype aNerrame = < Initialigation>:
BQi- Tat XS4 If STS Vads & type THEE
Flood %K; I Kis a Van. th type tloat x. :
chor chy ff chisa Vad. ot type chala.
cloutex
Th thts both Vos names are Same but datatypes are ditoctent,
one von holds value & other var. holds Address.
ints int ¥S
holds vatue holes ads
,OOkLAs Methed pd Methedd
% Maint)
Tat $3
Parr 100 05S
$3.
pe clvadue ost an", 3)3//le eK ORM
pe Cadi de St -buln", 5227 1000 1050 1006
PF ec’ value Ob St sien ln", hs 2/710 100 ‘e
Pee" vole dr M3 sieuin", KIza to00
ain, RD; M7 1870
a \n", %& RD; /1 00d
pret value ob St oid 10", HD; 10
pe chsh" x25 Y Fnvalid .
4
*& Gntt 5
fat ptr
> ptr tsa wr ob type Int x.
> % peY gives Toteger
3 Tht pty we cam stme adis yo Tnteger var.
—> PEY TS called a3 pointe, var. ty tyPe Tnteger oy Integer pty ) ptytn Integed,
—> This opuotorcx) giver the value athe adys printed by the pointy.
Maint)
a
Tar = to; KIRAN SIR
NOW WITH :
Santosh Technologies
Cell: 9246392345
int x pte
ply = &is,
PE Cela bd in, x pts); 10 10
fs 455
Pe Chota shed", Cae pele eae
Xpty S125
Pe Cbd bed in 7% pty: Az
4
As parthe. above process se per ts veplaced with obseck Ci at that location
x pty fs am alloy to T bes alta to the objech Sr the specitic. location (Adz).
AB operators veturns a value , only * vehrns the object Clecation).
+ Maint?
4
int a=10;
int ¥ Pi P27
Pis &as
Paw kasPh Ciekd led sha ln", ap XPD: |} 10 1016 :
HP, S455
pecheled sled sted tn! 1 XP, *P29: ll ar Urde
Pi=Pos
= xP
PR std sled she ole", ab, Pi 2¥ Pa > Maras acas
“%Pa=b;
%
* Maint)
4a
int azo, bel, cz
ink % Prald , x pvala, xpval:
fob ty
Prald =ha;
Spiak = ape enol eee
& pala = xpwola; Sai gi
eae Intosh Technologies
Cell: 9246392345
PE Cle od sled", % prod | x pual -x pval):
4
Levels o> pointers 3— /
we aan face any nov dr levels cb pointers, Thae ts no restrictions on the
levels ctr pointers.
Nov dr levels are #98, the prgmng code can veduce
We Maint)
AE AS1O, AP, HM P2P, AMM Pe Pa Py
Paha;
@D= CxPto;
Pape &p;
(A P28) = Com peRr te ‘
Pa pep & pap Ss
PH CMekd abd std thd" a, AP, XX RP, AK Pepap) «
‘ S
lp. ASRS as 2S©
% Void Maint)
t '
re ts tees
nt & pers 4} — 1000
Tot xkpftr > Rpt pas
int sxe pppty; _Per~PI0%0
pty ~> 2000
asa x ptr too Ppty—>3t0
ual Pptr—>ac00— & eppty— 4000
prey = depts & ppty—rasog —# ¥ PPty—s i000
pprtv=&pptr; —-X ppty—pao00 *X% Prpty 22s.
y
Maint )
de rei ei een: KIRAN SIR
1 Majed Wn" 22/8 Ss NOW WITH
Pe eet ed; [404 antosh Technologies
pected tat, 4¢@095 [110 Cell: 9246392345
Jekts
PETA AS Y/L0us
PECAN Jo, (4H
pec aled tn, R592 72404
ae yeu You Jouo
PEC ahd sha arate, RAK aK, RBRI: HT IMP
ph Ched ebd opedend hd lea) fei, vd, ANG S, KEK HAAR;
gan; fw 1 (0 10 to
4
Propetia dr polnter:—
Ve The Sye_dothe point Wieapective dy data type uovty mission processor (be tine
cated oy opeating, System).
Main()
t
load xs;
piCatd sea" sige a(S), Sige te &KS))s(J2 4
3
depends upon “the mission processov-
2+ An Integer Points will accept integer type Hood points evill aacegt toa type
Fey Same ype & printer.coill aacept Same type -
Int fs 0; Floor = 3924)
< thea cA;
int etptrs Flos xfptrs tu ches ¢= 4 ;
t 4s fptr = Bes char secpirs
pera &1 5, x pokesto SH A
9S mI he tes °
cet or
0 "00
oo gr 1o-5 (0 foo
Th odes 10 hold any “type pointers we have geneste- pointer possible by
Noid pointers. yavoble
%& Maine) Noid, Spee: Hfrnadid
a4
Void xvptry
& Cala", Sigects Cvptr))s
G 1 Sigeets CVPEY)); Ja KIRAN SIR
‘a ) sow win s
* ne ogie:
ore roc a8
fea avers Cell: 9246
PR ch ea", siseab Cup); a 3 ots
Nets & te pectin) aeCiate pte;
PECTIN HQ, Cfloade) yptr); — vpty=&€: S Typecoating
Quen;
k
B Noid pointe:
“The concept cr vold painters will be used toread the device adns ot “the pers.
SS: pendrive.
Arm pointy Vad. abt the me tir declatation it can be ‘ritlalige uth gue or any
odss oy null.
Te we Initialige with null tt basically cabled 05 * ruil pointa".
Ita;
int * p.
int xp =
What ts a Null points?
tr null por hay a yesened value , Sttien bub Mok necumecnily the value suo,
indfeating that 1€ ~ebers to no object. Aull pointers ate used routnely
Potictpating In C& c++, Whee compiley_time constant Null is used - —
Null porater means it 1S not vetbeting to any okyect but untnitialiged pointes
can contatn any value (Jwt Ike any othed unloitioligesl vabtaed, which >
we call godkage « 5Can't Convert ‘integes to Intege pointy, bub by making excligive type
coating by USA We can assigns
tnt *P =100 Sint xp s Lint 4) (002
% maine) Tai
Tok KPuL PD
PredyPay //Tovaltd, rosy & @roy can't convest trom Totegese & CfAP2 TO Tateged fs
fgi- Assume loth ae. ptr vaniable-
Piss R=600
Assume thal P&P ade pétnics variaices .
&- Addition vr pointe yanlable ia constant no- addition *s possible,
% —
Void mato Cvoia?
Pat Orbs ¥C >PEC" enta 2 no'ss''2;
Steteld sh", La,¥b);
Ce check Chad);
%
Fink a cherr C late P, inb<2.)
Goh x Cheek (Tak, Toba; Hicheck, Fun baker R Integr ap aials & nehinnga pty ean Tnteges
PEC™ 1m Greodes 00s t steeh", 8095,
N SIR
he ceenesed KOT aioe”
o elu CP?; gie:
se Santosh Technolog
Reco Cell: 9246392345
Points, +o function :~
Funs have ad's just like dasa items
A ptr toa fun. can be detted a4 the adrs cir the ende Bxetuted when the
cluny IS called,
A fur's acts ts the staxting advs ob the Machine Jang: code dir the tun,
Stored 19 the memory.
pas to tunis are used th cantting memory restdenh proms watting vinuses, oy
Naceines +o vemnove, ruses,
decoration gra ptr totan-:-
The declasation dra pirtoa ‘fun. reauives the fun's yetun type & fansaag’s
St 49 be specified along with the poimia, vantable,
Syntax: yefanetype (% Print variable) Cfan's arg's st);
Thus, the declorosion int (X+F~) Cink, Int»
declan, fpto be a vad. o& type * pointe toa 4un- thad take too nteged aig!s
& retain om integer a3 its value"
Thus declarations :-
Nowmat
tht Tevoid)
declares iS 40 be a fun.
Uoith ne paseumeters that
xelum an int
Es!
int Fumi Cint 1)
eke
}
feed Fane CHoad-£ )
return F;
3
Pointute function
Kein (Rip) Lvord)
declare, ip to bea. pty 40 a fun. that
returns am tnteger valued taker no arg's.
Maint)
int fep) ctav; dedodation ot ¥, 0
Flood Ce? CFleat ?; I Pirrofune PHC sha m0,
At fa10 SHO; ho rsp,
Float f= ery Me ee
fined jee tase amor be:
feabla declaring the fun: prototypa & 2 ptvs p&p the fun's pis amigned
the adrs str fun- funci&a tS asrgned the adis un- funeg.
“Tnvoning a fun. by using pointers.
Ta the ptr declasation +o -furs » the pty+ ods along with the opaccd(<>
plas the role tle the fun came = Hence, while Ynvoking buns by using ptr:
the fun: nome te replated by The pointe yaoiable+ “ee
KIRAN SIR
NOW WITH
Santosh Technologie
Cell: 9246392345ARRAYS
“AS wT, “An ordinary vane com hole only one value ata time, Tt Ts not
Possible to hold no-oh values. for suppase if T want tO Stove Jo subject monks
Orthe Students ,we need to declate 10 Variables. declaaing the variables 1s possible
but Te Ts not a yecommended process.
Since, the logical stmis nove times vill be takes place unnecessarily, the steps
tothe pramng 5. To evacome ‘is piblms we use arrays.
Definition ote Array ¢-
An Aroy tsan derived daiatype which 7s single subscripted vere which an
hold “nh! no. ot values. smenston «
Syntat:- dada type \lad-name Lsise} 5
intB
Egi- tok asi ele 2 a4
f
RI ee wr ROACH
eee
ca
ea
wheneter on Ariay yor. 1s declaring the sige te the vad-,must be debined once
We debine the sige, This never possible Eitha to Ma Use.
An Array 1s an homogeneous type. res 7t con hold only Same type wo Elements,
The array always contatns the 48+ block adis- ie; catledas boye adts
The array elements will be fdentify by the Subscript no's Externally, but
Tntemally every block will tdentity bytes own adrs.
The arroy adrs's dr Each block INA Seautentiol Memory bloc
Theyode & type dr arrays s
a+ Two- Dimension. 3. Mult? Dimension.
A+ Stagle dimension «
Declaration vs Single Dimension Anau: —
> int alsl; KIRAN SIR
> Flood anil; Nov seta
> char nome (251; Santosh ~ ‘ogies
> Ink OLS) = 4,-9.2, 4444 Cell: $2-45392345
> Floar st5}= 2.49492, 11409 494,
~> chor name fas}= 4" Anusha! & ch nametasl= 4 “A.nv,'U)8/4
> int C3;
fot SLnds Pov.
> fob awl J= {iow l2ys,
= Int awl3;
art 3= 44,4, al) invasid
> Int azioy | invalid, ‘al tsa vad.
totaled; [1 avay sige. 18 xed
Had—> const tat astos
tat anv Lad
— > int anrl200003;
> Int aL doo): J] fnvalld, a8 pA Ib bit not posure.
long 0 L.a0000}; $2 BIE TS posible , bag 16 bilsige = 65535
32 bib Sige enilllons th space.
>
ink ots}= 41043 [OTST STOTS) jot me Fired declotationth on avan,
atteast 1 ae
> edebine MAX 10 a | Elerrentis iniflatiged , Yemat ning ate zeros.
Ink avy [Nand ,
> int aLoy/] invari s beog Index starts with suo,
1 eo
arene KIRAN Sim
> ‘nk asa: TaD av 1: > Santosh Technologies
—> Whe aL 542); flinyatid beog sge'd Cell: 9246392345
> ink aU 57235 JI valid, bog sae)
% WIAP accept an amay vr Elements, display the elements
< Stdfovh> — Zcontorh> § sy Feotfoadh
> int Inder no.
Maine) ' 4 °
a ali] Samay Element
Tnt On (pod; any —> ansink base adrs .
fot sigests
clsexey,
PE Cenita the Sige ctr an aryay!!):
Sk Used! &sige)s
UI Accepring OPE enter the size oe an anoy 15
forcteos Te sige 5 ire) Enka the Elem os Onrloy, us
Lv - oot 14
PECEmta the Blenedat arfeldd $”, 1): tayt
stat, &awltq)s (aj ies
% [ay 99,
Uf display 45°79 61 83 49,
forctao, Weslae 5 +t)
PRCHensd", arc);
gerne);
retuyna:
a WAP accept Sere Elements tn aray find the Sum dr all the glement & display
— Ltonforh> the Sum)
mone?
Int anLieds
ink nf, Sum=03
clrsertys,
GPP C"ents, the sige oan array");
St Chal Rend;
Accepting,
fort Teas ten: Tt)
we
PEC" erty the elements dir an Teledg ty 122
SECA", Ral;
for(l=o: ten: t+)
Sum = Sum Fan
PR Clsum ob the anay Elements +" sum
eae,
&
KIRAN SIR
ney He ologies
‘osh Tec! 5
“Sells 9246392345
WAP accept Some Elements Gran aray dtaploy the Elements am n tp)
Magnc)
Tak ave Li03, 0,7:
Clrsexeys
PF Clenks the sige or ancy): //y
St Ohne, nr;
for cizos ten; iat)
t
PF Cents the Elements OF ON Lopdy x!
SOMA", earriy):
4
forlten-ts 1
PE Cele anvi3) : | Uo 30.20 10
gucho;
4
foe
:
pales
13] 20 80 uo
WAP accept the Elements dr an away & alin accept one element nd out that
Element tow many ‘mes rt occurs, display the count-!
< Sidiovh>
Mosnt)
Fak alasd, 0,7, Cunt=o, Ele,
clesert)s
Pe cents, the age tb ne'l;
St sted", BND;
AAC ts05 Fen; M+)
a
PRCMErie, The Elements Ob a[ sds) ;
SEC fat, AOLIYI,
4
pec''entu-the Elemenb tasearch ele);
SP Chled", &ete?s //19
o 1 23
to [30 [10 Tuo
cfotizosien 144)
t
Te Catry= ~ee)
t
Count++
g
é .
it Coount: <0)
PE Clumber not Exist" ele):
Else
" '
PRCElement sha 7s found «led time cle, Count}
gekchty; 7
&.% WAP find out the 24 maa- Element from. on array?
aLt] 445m ;
else
tow
pe C Abts delelationtiny:
forlteos fenzixt)
PR Cepsa", ati);
getehor;
4
KIRAN SIR
‘NOW WITH :
Santosh Technologies
Cell: 9249392345* Maint)
a
Jot als) = L5.115,20,25%) (SJFs Ds foobes)
or 85, kelmy [=| soles)
T= Fat: Iegs grated
Jeatlers
maaltetls
PE Climate vlad shot sha" B31 7Ca))://8R)520
s
2
% Mat Kina sik /
Ant alJ=210,20,30, 40,509 » noe Ncrnorvedies
ft : osh Tee! 4
ink fe3,x5 Sant! 9463929"?
Xa AL +2kal-1] +3xafa]e Cell: 2
PEC a);
te.
passing Array os & fun. padameters :-
na fun. we con pay a Singledimensionad » a mubtidimension a9 a fu0- patametens
whenever a Single dimensional amey 15 paring aya, Fun. podametd, Te veautre min-zargs.
The first ang can be any ype it indicates an anvay , the Brag. incicatey the Size
mug be Totege, type:
Syptar:- tehentype- fun-came Cargil tag o£ 3,~ 35
% WAP accept am away dr elements & display the elements by posting #8 Rin.
Patametes ?
Void seod, CFloat £4 int);
Noid write CHood | 3, intr,
vote)
“Poat atiol:
ot size:
fC bets, the “y *
Es RiGee es? a stclines @ALid );
pt Clemtu ‘the. Elements ¢)q!"), 45
read aise); ff eadder [{venct (Rated tse), Noid write Mead of, ten)
PF CI The clerments axe ~~~ 272; ats
unite Carsige) |} cutter agrhy ford tsos 1275 fH)
geno: gine oF aN Po Cole 260", of;
vy ca :
Votd read (Host at 3 ,tntn J/I catlee 2
d
totes
Oct
for ieosfeny Vat)wheneva, an array 15. pasing of a fune paramers boy Aebouth 1 pa theadys
tothe array [hae ads], 8
Ascthe Away fs pauting adss the concept ts call by adys.
KE rn tis pigm as an Subscviph 1s Yecleving -the ads, so 1s X and [|] both de
Same or not?
&2 AS AM away use the ads then y canib we say any tsa pointe,
oY, butthe diff: fs,
% Fars; KIRAN SIR
ata: [vated Now wart :
ast. /I Tavalsd , integer cst) Santosh Technologies
othe aP: Cell: 9243592349
prt: vaya
% intatsl:
atts /| tovalid , btog a contalng cnstn bose ads,
Hete, A> cnsint petnta p> tsa thteger potnier,
Note:- Arvay name always gives the base adis tr the every Corr 8 Lavrte3) both,
ave Same
Eitha we corting the pig with Subscript ods ale, internally they will be.
Teplace by the pts.
Void Yead C Hoal ¥a, Int 1)
The deb a the, tend Aun. internally voting with pointers velba than Subsoipe
the deb t& tod can abo be unitten a3,
% Noicl read CHoak ¥a, int n) % Noid marnt)
ath
jatty ‘nt onrfs}= 13:15,23, 38,454 5
for eee pears Wr DY eG SOE
pe Chea”, x cas); = = tame [be [is es [es]us]
i) = = xa /h an
SoAinally x= LJ CMA amr fy PPensint baseades,
¥*2L3L) 4 “
***=CICML Je ete,
* Noid Marat)
Wh OMLAl=46,10,26 36,464 »
int %pirs ° [ 7 a \
plr= Rant: Is 16 [56 [86 [v6
oI pe Tndementasion w+ points t
. Chstrt base adys ,
4 X ptr: faz
PRU Ls
4pre. Tncement potates
trey >
ret > Poe
ie spre decrerneny pointer
pir-- > pose
Ate ply > PIC TneIemegt of object
=~ %Xpty > pak decrement ole object
phat > post Tncvement
feph-- RSE decane
Kea pty > Pie Metemeny we point & accessing. the data
Hp e¢ > Actewing tredata & post tncrementasion th golnta .
Raptr > ME de Cementationsty poiiteu& acreying the dada.
Apl-- 5 accenmng. the daad post decement the poistt.
. anu) {2 8 4
* enue fe Terese we}
Tht anrEs}=d Gil6, 26136 464s constnt base acts
PE Celed sled steko) arta, #COW427 KALA) /2fanrl; /J2626 26 26
&
een) then we constuch on amray Sauential Space ts resavedt
<6? | & a casing pte Is gendlated with the nome ob avrey as
ao a base ads$. tae conrfotably loeting all the elements
stein) | istth “aden!
sxt24400) wie RAN sik
4104 wWTH gies
se J preston
4 Why the Amoy teder Stang wth uo: Santosh 163.923
4 Cell: 9
anil —> xan)
%CH00+O) & ROO
ost Ci} Be Care +1)
C00 1 sR: .
“This tS seu anay stost with gus, physically 1° oe
pAto}—Sensint base advs
Void motion)
Int ome = £ Si 2S. ReURTQUS
ink epics
es aves 7
at phy oor
ome ply a
oe ters
Pe Oa TREE ana’, aa pees) peo 0 4%s Maint)
A
nt alse 466.2645
oe gu oe
efecto le]
tks [seo] csint bee acs,
+4 (OND
+t OLQ3
PEC aedakd stad ht", alo), xcati), C244), AT) ://4 18 260.
4
%e- Main) O_o 10
[aie [su] ie)
Int of5) = 988,54, 23,484; 7
int wp Cnstee pare adys
Pratt; =
PF C'vhdebd hd’ EXP, xPEe, 4+ +721) eo ae
S aa sary
% Main) — 1
fo 5) =20122,88,auiss45 [» Taz Tos Tx [= J
tne BESS dee,ae hy boye advs,
beay
pe Guled'', BL): /Jevvor.
crane bared gs
; Cray ESET
Ree Tos By ee St
bees swe idee anign one avroy values with anothe anay.
* Mbind)
a
laste tot aLS3= A214) 6161103 2
jot 1, bes:
forlizos jess 144)
d
4Caris. &b2; /Jeatie,
peCHed “led aT, 6;
&
5
£0714) Hoallee 1] K&R Notation ,
int ty Ys
a
Te Mytans
Ole 24 44 6S 1s Ir
“Joo toy joo Toe b
aelelele) [=] © 6s)
ao PO
onstrt base ads
a IRAN SIR
x yer c) ee Gals ologies
intapy: cosh Technoogls
ineig Sam 46392345
forcico sre10 98H *
alij=ix
Pe Cled oeq!, alsl, atag);
3p
Tn this. sige 8 the aay #s Not satistieck
only loop ewill sodisty. Bud sill ce cry doen
YEH any Pros- Since they ade. no
1 SePporting
bourels cheeningsArray de potnters + -
fot xalsds If MIs avay com bid sadrs's tn Each block.
td Marat A soo mn SY oe
mene
int ACJ=2 414,24, 84%" renstnt base adts pe &
fot BED Lest 261364: a
Int CLV = 19119,24.594; epee aoe
int ptr 3; Valera]
pega: crint bae aes ig feta
jnt te ppt er S
phrlo} = a: /f pete Atel s (| f=} Te Bt eg
pHid=B; eae
pebed=c:
pptr= pers
forCtets less ltt)
iv IR
He pper tats or echnotod'S
set ply elf petinorement pe santosh 434
A33922*
4 Cell: 9245
== pptsll predecrement ptr.
po Clinsted's ¥% ppt:
Aa Cha0; 35 itt)
PR CMebat, ¥perlid
Ads Cimon fey et)
Ptr Cunated shoe ALT, BLT ,013)5
focro:
ios : tesgection,
7 WAP accept some clemenis do an array implement the opetations 70 2
Union , sorting,
Magnes
Yoh accept Cink £3, tntd3
ota tsptany Cit, Tay
Noid Sore Cint( 1, intyy
Tak totesection C atl, int J, intl J, Intsintd ~~
fot unton-arC tat lI intl, intl, ints inte
int af], bl26], infz0] ,un{ 40] , ran, fe,ue;
ehysexey
peclin Ente nas we Elements Ad ar's I! .
fe Clea" &ms
Gusph Cin énta novds clements 48 6:2 /I4
stchra") nds
PH Cin Enka Elements Trio at
accept (am;
PECAN: Ent Elements into bt!)
accept Cb, nz
elascrey;
Sort caumn?s
Sort chi);
PE Cin Elements asY):
Dspay Caunry
PECAN Elements
disploy (binds
tee tatetertion Corbet) mn
PE Cin Tntusecton 6 2 arraigs"),
i@ Cie==0d ‘
PE CO Elements"):
"ys
ese
dicplay Cin. ie);
Ue = union ayy Carb, um, m,n)»
PE Cho union stew arays:
display C unrue):
guacho ;
4
word accept Cint xa, Tntn)// Rertsictionats
ti Jiao
: acceplcg ees
Got 5:
choy Cizovien si¢t)
a
‘Stombs Cejed", ai); [158 3y 24
sor Cizo: Seis je4)
t *.
ie eae) ==* Gia)
ca
pF Clements abeady exists \n!'2
pe Canta new element Int):
i
Noid display Cint acy,tatn)
yo tng bet)
PR Cited Hy ecatt)s
Noid Sort C ink #2, Int 0
Fr Cisovienay itt)
ds Che THs den 5544)
TR Cecatt? > SLO)
t
bexcatld:
XC Tea) = ACitad;
Cats d=,
KIRAN SIA
2 lO:
Santosh Technolo J
y, Cell: 9246392349
nk intetection Cink O13, int xb, tat xo
int m ,tntn)
15, Keo:
for Ci=05 Femy Pet)
eee
4h (Seo; Jeny 54+)
4 CxCavo)es % (b45))
4
+ CCth Da xCati?;
Ktty
break:
3
¥
%
tetuyn KS
&
ink union ars Gint xa jint BET, Tk xe, int m,
break L fntn)
i tne fa fakeo;
§ while Cen && Jen)
3 Lie C ott 2b053)
eCky=aLi3
Tee
%
ewe te Cari >btid)
d
ek) = bL53;
Seay
4
ase santosh
¢ :
0) = ati, Cell?
fay
Seas
Kats
2
while (Tem) i,
a
CC ky: aLids
Tete
ket,
3
tohile (jen)
a
Ck} =bCi3;
Seay
katy
neha ky
4
Double Oimensions: -
double dimension ariayt is nothing but combination ot yauas & atuning
many opps ean aly be designed by easing double dimensions. Mathmattes , ori
apps ore. designed by using DUS. Business Oviemtedd apps are designedl. by double
dimension aways & the gaming prgtngs are ale designed by Dp array,
How the Blements ave arvanged in Mutidimension array? ReDy IVE ~
“kK Moin) Maint? Cofepe fae) -
‘ntas 1 tnbars] s {1020,seyus4, cnt
PEC ed" a,ha)s [151100 Oo PRCA Hoot! ankadj//900,101- adys D
piclsra", xa) > /&nor , Pedhvapaeys ita 5gytax 49) OBS:-
dadatype Nes-name. (now Leo!
ds
a eo {ebk mast Gan be. optionad when you ‘pitialige
% Wtalssle gf dainak VWomek 14,s0y 5
Gab als Ode 2 tos, 1a, 18945
eae Le 56 Ys md J x Mees 6eh 2 aor,
Ly phoned => BIG) .
Alepends on the column Value j1a.25 will be calasaiel
% FrtalsIE 3 = Livieisys / invalid» bean wb withouk column,
x intafsyrty
Sued avay = PE ROX DO]
FAK KE = l2byttee.
Eth any type dx dimensions , the. ads alutay, will be Seastential _
* Mae) low SPF te fae |
IntalslQ2J = L to,20,26, yo. 50/604 + atmo [Sot 30/4o
PEC a" /ads (50 3400 | sat so | 66
PR Cohd sha "sha, Xa) /} 3 5 yarns moka Single a
ph Cea", xa 2 /M10. dlimension avay ,
3 SO) UR venuve 2 pointers to show the Value 2D, Ny FS £-D we eatae * Ol) > & (*cararts)
intl
|__|
ates se(xcari +i
ANIC LACAN ATIEA)
aC CIT OY OCH Ce CAH IH)
% WAP Implement Matix Addition & Mubtplication
Wold aceept CONECILRL ints ints (34 rel
Noid disploy Cink (3603, tnd int 2; t
oth prod CAMteIEs) , at E MWh , lat YL] , Hat st see) wes 2 2
jet mst) CRESS) i mab CICS , mad ACIIEI! a S$ >
cons
Ink ig ) KiSMm 11,92) O05
Maint)
becres;
Pelants the 3e tr Maki) nds
OVO tSEC ded and” Qu BEd;
: gum 20;
PH Certs the Sige ot matadn'y:
te Cemen) fork 203 KE2 SKE)
u t
PEC'In entes the, frst madnia\ell) Surg =Sum mi CiUar.[KCD)+
accept Coad tyre .c1)/ . *
pf Cn exten he eee maLiIlsJ= sums
aceept (mab, r24Ce)- {
ECW the Elemensin madsiailnyy 4
display (mot, 340103 ,
"
PFC" In The elements th madoix 2) n!ly
display (mat 2,421 62);
pe Chin product ob 2 madnices --.. nly
PIA Coad ly made 1 mab, gla, ra): KIRAN ele
: ow Wh 7
anes Crabs 141902); santosh Technoloaie*
4
abe | Cell: 9246392
p& C\n Mubiiplication not possible -~\ri!);
gach:
4 *
Ned accept Cint mat IL], tate, atc)
t
forCt=0: Jers 144)
t
for (Jres Gees jet)
SP Coa", ae (made S):
1)
5
i display Cot mad{ICs0} , intvsinte)
torLicos tery 744)
d
forljeos Sec SH)
PE Cholaac!, x (mab TD):
PE Cinta,
3
4
Vo prod, Cit mil IE2 rok me LICH], int msl ICL
a nt fot @, inte)
for C20 jen sith)
4
FaCiees JRC sity+ BK WAP accept a aX8 matt find the Sum vt principal diagonal Elements.
WAP accept o matrix, dlisploy the Transpose st mataix
SOAP accept a SAR dimension patria display the minor image & uaakes mare ot the Matta
lint ow Gall:
| aod C0} AN sit
26-9 ATSIC) «ee wet goste® 3\ar\3-*
6-> aU} fn 249 a
sh 24
us-> asitay sen 94039
3 alata) ce
S als) ts),
*
& Maint)
Lu
Yatavy CSCS 2
Ph Condad se, Sect Grn), Sze Camb), sigedr CombBtee /] 50116:
% ie en
SGel anLMlo})-—> Rowaantain scoltumy So, 8x2=16
x* ae alfa} = 538
Fnt aLAILsJ= 1 Si sv sors ati3¢2} = Bs vide by poykt,
prCinshu', Rats}t43- Lalo: =r eis
teat
4 Rwo=4, cles,
AIH. tn Memmy Incetion. =. (CHAT Has
142 = -16
nn TE bytes
ators)
Malti dimension arrays: -
Begteally move tan one dimensions usill be taker place o30, rust cllmenson
Grtoys, toy Earyney et the piginng, we we mulidimencional arrays Lnathing bur
. To lebtmast tam be Opttonet, when 4
fe Ine opal EIU: YOu Titatlse.
Blots FOU Colsuonng
SiZe x WSF = 120 bytes
Elements = SK5KG = Go clement,
10Gc
P
% A all = dd avast dungh, L hued dromayt, d iin e y detm
SE ee aes
&
%
» Tok any CSCS 043051 5
off block,
int any UASeI
Sil
Tok anv(siCusCs] 2
1 — > ary [od Lotte) «
34 Dar tNtgury
ty > anv Co} 23082
say Rissa:
QQ Dav ICitsd
N—> avyTo)(23 Co}
| > af ellos Lorfed,
hut anh 3en0903
2\4\)
ya ay > eee
doce, Y3
ase.
axucavei Ee) | sas
ow Od CITSI03, aB-< ale ss
us cyl ag Ji ep 3] 4/8
10 © 4 sae
W is "to! 30
‘
Ih msg FOF —52¢
Wo we Ent File,
Gechal:~ The getthaat) fun. te
IS Sim lay tos,
accept the, FO ‘hoe both $b1s fans 5
Tp antill the use Pres Ent Key Both aan
The getharl) fan. will yeag Oly 4 chad from the bubbes
GAHAN) & Sk) both are Leann the Stetiveh fy
%. esidioshs
Maphie only debaleye,
ead File | ~
Maint?
t
chays KIRAN SIR
pe CEM the chan whe NOW WITH
Santosh Technolesics
st Salve", Segre 29234
Cell: 924939254
S™ getthaytrs
PEC sI9c SOY
geteht>s
4
it reaching the chas's trom the butts ,
The geithar() & sc) beth ead the Ent keyas a "in! hich have the oye
HH guchec) &gerche> :— pono
Both this “kin's ade Similoy both Will accept one byte ob chal-ay
antip.
Thue bothare 4m the cnlorh header tile
0832 Pups aes
domancw —> o&80 Padoun —s oe!
Lebtarow —> Ofte tome 3 OB)
Right arma —» oft
.
eee
Chak $1159 5 KIRAN SIR
PFC" Enty, the. ches") ; noe gennologies
Siegekch; Santosh '¢ 5392349
Sin avhn0; cell: 9245
PE CMhd sb", S12,
gacho;
pute & pudchancai- will display a byte ey char as an olp.
Whaexc & whaey(y:— fem Coniosh Heada tile,
whaexl) we cint horigontal cussor position, # setuyns an int+ vale in the
Youge &- I+80+
uhaeytrgiva eink Vertical tars position y it setumn am ink Value tn the
Yonge Or Im25,)~43 & i-Sv.
gotory Col prow) 2 —
The gotoxy maky you to move the cursor ty any position ob~he.
SCreen as poy the. veatlrement Column & Row vatiies% WAP to move the Cursor te any position oh the Screen,
Noid maint)
oe cht, cha
fnt-arys
cleserey:
chi=getthtr:
while Cchi==0)
be = gehts
= whelext);
Y= wheey Or
if Cohes= 42)
gory Cs ga);
if Coha== 44°
gotoay Cansyye
iP Cha == 803
gotory Cryei)e,
2 Cees)
gotoxy Cr, yas
chi=gaent);
y
4
update the above code tn the prime number lagie.
Gesl3s- The geist) tun: te a String Tp which actepls only a Strings.
The gest) ans asill crccept the TIP until the useq preys nid Key,
‘The dilly blus the S#C1& gelsC) tan. The SPC) will not accept the char's when
cthe Space. fs occurs.
The geke) can read the chai's Bi trek the Space *s occurs ate,
PulsOdi- The pulsed tune estll display a String oy an olp. PURE Con only cbfsplay
puts absay shows the. next lint, Serecng,
Moant)
BE strLiog) 5 2
ph Cema the Sting!) :
HSE Coles", Str; ae oa
str) Ents the, Sting “Tafs ts dota . 7
ren Tits ts cteda >
p i This ts data. >
4, deeho >Cc
E
%+ Example On Screen Saver program (Scvwlling).
Noid Matnt)
bos stl4n, chs
Fk FS, RCs
chrsertas
ext models
pt C'enta the stringt');
guscst:
Strupr GH)
streak Coty" "Ds
Sor Curcortype (~ SoLiP CORSORI;
hse);
textcolor( Redd:
textbackgvound Cwhite)s
C= CAo-strlentstif2 5
goteny C c.1222
Cpe cMoes", st>2
while Ct kbhTtC?)
a
che stole
fos Ci203 te Stilen Ct 744)
ca
SULTS> SELES
4
StCi-] ech;
SEI= ws
goto CC 22:
Cpe Cees", st;
ddoy ¢ 1009s
xy
geteheas
4
Me -S Ctypeshs ~scharacts type.
KbhiF= Keyboard hit.
seual> Ena Key {Ameang ntl prey
frinese cdl any
\
\
|
KIRAN SIR
NOW WITH
Santosh Technologies
Cell: 9246392345 |
/
/
Tis 15 chon type sh fuels, they esl accept 4 byte ob chot oy the Ascii Code &
th mm Taga, ee
sh Yet type o& dp Erthad ao.
Sa fot TsolnumCint od:
‘Tnk tslowes Cint ods
int tsatpha Cfnt cs
int Gdigit Cine);
ine Asasen Cinte)s
int tsupper Cint-or: ~-—e40,2 Chypesh>
Maint)
chan chs
PE C'ento, the chase;
Che getehare>;
if CiSupperch)):
PE Chappe aagetd:
else WR
12 Cislower Lehy? ei AN Ss .
Pr Cours e920, SW WT josi2®
alse #8 Cisdigit Cbd) ost Tee g2 34°
pe Cl oigieys se 9249
else el\*
TE Ctsoacnr Cony) .
pecYsci"):
geeho:, t
&. ~
Touppaco: = Conviat-fom louwetcore to upperanse
rolowerxt):- Cova trom UppeL.aaie, fo loweLaye
che ‘A —> che chyar = ta!
che ch-az = ‘A!
FF you. want to accept more. ‘than one char 1-e; o String then string wrt! be
aecepted by 2 derived datatype, one ts array Lanothes ss potnkd |
+ Magnt)
alv035 QU" Anushet hs
ant Ty
Tao,
while CT 1e6)
at
Pe Cac" strLi3¢ /hAnutha.
Tees
g _
x
Tits condition te nob padech Condon. since, the length ohm the strig ts
Fncreoses & decrease tt ts not a propa conditien, to splay ‘the 617, we coon
Need +o unite a Condition that hay te work forany noo chars, _
Bosteally Every String Enc eatth a Spectah chai cailedos Alutl cha).
,OUL%- Mant)
a
chad stv£J= ¢"Anusha''y
Yok Teo:
cohtle Csw033 te 10)
4 tae Siti)?
Tees
3
4
Cell:
Every Shing the Logt chaa. must be a nat chad. +d\the null chad we need to
Specify one. byte str Space.
% Whab te the diffs bln Chase & chart 3!
chonl 1
Maint)
Chay stvbs «Ynshs!;
pats Catv):
_
we snusha eoith gaabasechon!'s,
%- Cher OL) a cine baveats
PSP ADs)
aoe Be
%*. Maint)
cs Lie) = “Aruspho"”
puss cads
arate;
pubscad:
4
Ole: Error, since ‘abisan array which
Contains cnsink boe adys Neves, possible
“to change,
me eee
ches ated =" Anushoty
chor aliols
Aoy2as Frvalid
Stvcpy Carer;
Prats cone
4
A Anusha, The internal concept Eve
predebined fun ts written by plrs gs, Eithait
Uyitten Py avrey abo Fe cuorks
chaax
Maine )
Chea ast =" Dennis Rrichlel:
pus Ctx;
4
de. Dennis atichje,
Chan Kart «
[=] (EPP
Goo Ga~
LEER
Matn¢)
tv
Choad 4a =" Dennis Ritchie",
Putscars
arate
pus cas
y
ole. Dennis Ritehic
~~ Ritchie.
+ Maint)
thease. = “Onughd!,
char a1;
ainas
Pus Carrs
&
BP! Anusha.
%X + Thae ts no Coorg intanntly unitten by
anvary Every Hing on pointers.
initas cal: HK. Void maine)
SthLtoJs“abedeb"
PRC eles", Strt3% Pde
StrOst= 'b
PE Cin sts, st1)s /Jabbesy.
Str[3] = loos
PE Cinsles", str; Hlabedeb.
Strfsts ols
Styl33= ‘o'r
Ce "910; HlobeDeb-
Pretn sles", ste lake
Strfsd= 945
PE Cin ost, S04 Habe actly
Sh(83 <0:
PE Chinas, st; Mabe.
BHB3- ‘ay
PRC In los", siv7e HJabedely
&,
, Noid. display Cohan «pt
te Cineks" pty;
i Cape
display Cohan:
PF CXin oles”, pens
bp
4
Nid Maing)
gesting = “Hellas
Ai Seloy Cots
x
oid Matn¢)
be Sr}:
SHC e Nol.
sede ys
StvGade tel
peas Csi?
ale abe. with apsbore chais
[atraate
ce
fe
i
Cea
yaar
« ow
e
gant 0
cell: 9
a. Not vain
Hele tt eM tela!»
ie Chas SLs} = ;
‘B chet sxLeal = Ncobo! "+
QS.
pussy
Ilo ats
atte let troy
elto
Noid maint) —
L
cher gobs] =" "2
Seta ty
Pads C5997
5 2)
ole
‘Ve!
Se on of oF ee TY ie PAO
ensint bose adys,
abt 3*~ < String. h> i= .
Is SHCPY UTS 5 TeTags Ssource — Sting copy,
Fe copy the Scurce fo Toigeh String.
2 Streak C15); Shing Concatenasion
Tecom bine, the Source tothe. +fasge es ConcaHinating.
3B. Sevev CTD: TE eVverse the Styings
4. StupyeTds Phrconvert the String into Uppeaae
5. StrloyCTs tt convat the String Into botox caye.
Al the above String tun's veka ype 1s Chad.
6. d= Stren Cst9d; String length
Pe find the length dtr the Sting Tmetuding with Spaces
4. Le stromp 1,529: Shing Compatision «
Te compede twx0 Stringt hosed onthe acl! codes,
&. As skvfempcsissia; string tynoved compadision,
Te compare & Sting, by tgroving aue Sensitive,
‘The above 5 sting Fan's Yetun type PS tnteges.
% voA wan) .Alo’d Magny
4
a ‘
cha sisi “poucol', — [Ple[s[e]a] Re) “cha sitsege hello",
chon se Ts0}= “wsindou': [SERRE Re} cha sotage"cobo', DeellJTTolig)
Shepy C44, 5142) Seal. Steal CSi,%); CBEER TS
: Ths}
pulses, PudsCS)); |] Hellocobs) lo
ca Pscssr:/1 cove)
"pascal
% = windgeal.
H+ Skrtod CS24 Sit 305
ole S)=Hello . s2=cobal Jo
ele: Hellocebol esto)
% —Stacpy wwill Copy 4m ‘the given position & Streak abo takes place. 4m the ae
% SHPNC) —> Tt twlerse the Sting without null chad.
Void Magar) Noid. Maint
‘ on crane
choy sits ="dHello'y Chad SiCs0J=“pabeal;
Strtev ($0 5 Strvev C5)422;
pubCs: Pars coi
4 op alles 4
ae: Macs «"36. void Maines KIRAN Sih
q ; Now WiTH
chak SiLse)> “Hellosiotti2ia", Santosh Technologiss
Striev C459; Cell; 924639234
pals 051);
% dp Helloaiaioigg
Strlen(2t— Te-finds the length abr the stv
Sting length never Hindow length ot the nell char.
including wrth Spacey
ae % Maire abedet-9
a ’ f
chad Slo} 5 pee ee :
e tyCs0)e \abedet 9
Center the. shing'y: S at
ence, ae pecleled sie sha! stolen (5b) sSigetbon),
e 7 Mo bes
iz Sty ens) sigede Cabe")):
pe Clod"y 7): 4. Op: Bs 4
PF Cin ha “Stolen st)
getchty;
» Thists adata
op TY
M4.
K size de Opuaddh eit count the null chatacta |
He Marne)
Ln SC="eendezveusl ": Rejlek the
PEC \nopa%, # CS4 stolents))2
ofp eso.
% StrOmp2- The stremp totll Compare the acl code»
TR the. string! ascil ode fs greats than, the string 2 1 Then by the Abbt's otthe
first & chats th returns a ave Value. |
Th the string? arti code ts greats than the String |. Then th rekuva the difrs
orm V2 vole.
THethe total stitng 1s Same. in tak chasls Sbasel! vale then Te-vetun Zao.
Void. Magnt>
SiLS) x “abca'',
chen $1 C50) = “abet! @® MH compre 43 2 choy if they ale Same, TE moves hy
int ty the next chas'S. Tats Com penision will be taky place
eens Unttl the chat atFfers. TE algo compare “fe. nel!
PE Chole 9, 7)5 ches}
4 ob Sere i~ “eG ERD RRS
4 st
vabe@as" STRATE
op:- 3
* a . %."Helloabelts (rkehifo Te] qef 19)
e * Anuabo"!
“abcde” Te Shemp (3S, £459 eI RE TP}
- .- 100 Pecleha'sty: Ize,
% Stutomp:- 7 compare a stings by poring Casesensitive.
je
chon SiLsod~" Anusha eddy” KIRAN SIR
chat soCmj=" Anusha Gadd ys NOW WIT! to
Poe 6 Santosh Technologies
T= stitemp C51» Sad2 Cell: 9245392345
pected" 172 /JReo,
% WAP accept a Sting paagraph find od no- ob lors in thar Paragraph -clisy
Maint) the count >
a
char xchz
Tok 1, count = 15
puis Cente, the String:
ges Cchs,
olp:. Enta the Shi
foxtteos CHEM 1 = “t0!, 449 = 9
Q Tis 's a data
if Ceblig==32) Nos thy coms 3.44
Countt+3
4 uy
Pt Cine: ob mowls + sled", count):
geehes;
Ne
X WAP accepting a string vb pasagaph, display the paxgiaph in the formate et
Each word for Separate line.
Mainc)
4d
char Xs 5 Op: Ents the String
Ine es . é
fr This i
PS Cena “the Shing! ); oe
gets Css, ae
wake SLIQ}=* Sate
TR Cstlje<32)
sCiJetu
4 pe istn;
gelehty% INAP accept a decimal no. display that
by using o String un.
EStdiosh>
Maint)
4 ase Tao); fat n;
eeeane C'dectnad ro!')s
SECM", OM:
toa. (nisty, 25
PEC'Binawy no -gi ven no: elas", sty>+
Ftoa, (nistri 6);
pci odlalino. given no: #5", st);
Toa Cristrted;
PFC" in tesa decimal no.given no: oh str)!
getho:
Po Fn any format like Hexa, octal,
Conversion 4m Integer to Shing
Hoa > integer to String ( Src sderin, bese)
ntegee gathny
ay Fiteyte
Oe: Emin dectmad no: 15
Binay no. givenno: Jord
octal nz,
He 1a.
&. 3
* WAP accept a String 35 paragraph ind oud the Preeuenty sf. Each chor. tyro many Hime
Tk occurs 7a the. given String,
Maino)
Lu
chon xstvs /] char sLiv003 :
Stodie Tot A[2s6]: astis the totolne:s oscit velug db total che!
aR
elrscrty:
puts Cents the shring!d:
gescse:
forCleas steLth 1 =o! t4)
afsteud a ster ere
pecichad \t Ur freget);
aLspeitls al stesso)
2af'e!} = atiolfi cota
for Cte03 teases Met) a [stn albt -aca tis one).
2
XU
4 Cart | 2a)
4, At
PEC in ehe elem Lact),
KIRAN Sik
gently NOW WITH
y, Santosh Technologie
Cell: 924339232
oO-
% WAP accept a word , delete the coor 4m the given String.
Cke15
ie Csttt}=='t0)
SECT-stilen (wd d= Wp:
Else
4
Foi Ge T- Stilen (uid), Ket! 5 sti) =
KIRAN SIR
NOW WITH .
Santosh Technologies
Cell: 9246392345
‘No! St ket)
t
SECSI = stk):
StLIS = e108!
4
4
fd=o;
5
ie
Wd Cid} = ster;
dts
s
4
i+ Cor==0)
PE C'sod notfound");
the
PEC! Given Stingabtet deletion: was! S14
geno ys
enter bord to delete? Common
5
Ble” /& A-clawts a. gioup o6- commen behavtows & common Relationships */
Griven shingaster deletion? aclay tsa group or behaviows & Relationships.% WAP accept a String Hindowr the given Sting Ts palincveme or not)
Void Matnt :
u
Chas stl2o);
Tne K3
nt palindrome (char ty):
PE Cente the sésingy:
gets Cots
K= palindrome (st)
if CK==0)
PE Cl given string not patinchome'):
bse, SIR
PE Cigiven Sting. is palindromet); KIRA '
nolo
Fk patinchome Cehay stt3) Santosh Tec 3923
a Cell: 9249
int 1,1, len <0
while CstClerjt="\o!)
¢
Jen +45,
x Ciao; Jalens iefy iets j--)
if Cstli3y=st03])
“setunn of
yetuyn 15,
* WAP arcept a chas's replace the a$* chad ualth-the Second. chas's trom the glen String,
tow
5 Cte ne ate treplace C chart 3 char iehas)s
d
cher chi, cha
chad stcast;
Puls Clemtathe sting!
ieee wWoid streplace (chad xplr char p,, choh fe’)
Puss Canny the AS&char eg "
elu (sede 1s ie Cy PS pha
che getchaaty; i
? Te Crptr ase,
pass Cent tne att chars'tys * frets »
Fflush (sien); ¢
Cha = geteharer; 4
SYheplace. (st, chischa)s
Puss Cst75
Setehtrs 5 +% war accept a string st podagiaph, convat the lowe cae cham truppacae d
‘upper Care to lowe care tom the given paragtaph,
Votd convat Cohan (3);
Noid maint )
hes, stest:
Puss Cente the String!) ;
ges (st);
Conve 6
puss csty
gether
y
Notd convert C char x pty)
u
ee KIRAN SIR
ee ee santosh Technolosies
ce cell: 9248392345
it (&pty 5=94 && xply<=Ia2)
XPplr-= 327
5,
WAP copy one String dada. tate another String
Nord copy Cchas £1, chart 3)
Nord maine:
bea sts, Sos
puts C"enta the string! 2",
ges Cs:
Copy ($1 80;
puds CARA Copying’):
poss C20,
gekehts
%
Noid. Kc
‘i copy Cohat x pts, cha x ph 8 oid copy Cchox xpty, cho x ppty)
AR Cy XPpty 5 pt tt, ppty +4)
% ptr= x ppl:
kp e tly
4
while (& pertt = xp ep,String Concatenation: .
Nota sox Cohen ¥T, chan as)
tor C5 *T 5 TaH)s
while Cxte+ = ust:
&
Tmplement- the. logic. &b pagwoord x -
Void Maine
Int avbs
dsay
PE Center payeaod)*
password Ctx) /Jeotler,
if Cstremp Cstv, “#rugha® D1 =0)
PE Cin paxword not correct";
gereneher;
EXIECD;
1% any other logit execute it pas isvight x,
a=syb= loz
ph Clinshd arb):
gether;
¥
Noid paywod Cchar -xptr) /callee
bute a
otra gueney:
ik Cepty= =o!)
d
%& Pbr= ‘vols
breaks
ones,
Ph ets
4
Me
ot i
Sort pammoeh Cohar x): - nae
chok str Lol Lalnlels[el4)] TIT]
Foo
OU sponword logic with backSpace :~
else KIRAN SIR
z NOW WITH
a Cch==8) Santosh Technologies
TR Cq>0) Cell: 9246392345
4 evely
ptcielec", 5225
PEC es
i--3
i
ee
Suits obs
T++3
pectes
y
&
u
SELIV= ‘0's
iB Cstverop (sts "Aruyhal!d==0)
a
qotoxy (35,2005
pe C" please walt ----"2;
System (le \\ grep. exe!
else.
4
gotomy (35/205
PH CY devel poyeoord Yr
gechey
a upto night now we ale storing only single. strings if you want to
Stde collection oh names we yeautre clouble dimersion.% How the Collection ob Strings will store tna clouble
Fmension 2 —
%&. Noid Main()
2 oe
chad StC2IL53 5 €
puis Cstrto335 [gv
pods CoE) Igv A
Shepy CstrLot, “Helle se 2 KIRAN SIR
puis CstrLo0) 5 /] Hello
pubs t42995// empty,
Shep Cs0i “Anh
Puss Cstrl0} 9 /] Helle Anush
Puls (str£0 1s // Anugh.
4
Now witit
Santosh Technologies
Call: 9246392345
eS
2g. Wold Maine)
g
chad SifatsoJ=d Hello" abe! Anusbh, + iE
chad Xs2l8d = {"cobol", "paseas", "yavally + by
ers Ueabo!", “poseas's "yava'l a Gos | as!
HRCI=0; 1235 Tet) ee poral
puts Citi): sy
Ad cTH05 1635744) to
Fe] Poin tsramdory,
puts Csathd):
4
a. Maint ‘Array js: Seeuential,
edie cho 503 = Lee", “green, "cone, "please bs
static chor xxpty(J=4 $43,S42)S41 5h
chods Ppt
POC Im ees, ee tps
ph Cm abe hmm eb PHS
PEC Vaebsl) melee sv ac
=
ph "nets, pE-OCN +L:
i
peo AOL Roo a
HM bP = HH AOD = 1004 10 C"eonelo!!D
7 [iets ]
HO mM eh PLS eH — HAAS EH —— foOd9S oH
‘= % lo0a4s = suo+3= 303 "yo"
me
APL248 = HH CRD DH 200043 = -xy00
sts "g
PLAYA] 1s eee CRIA 4Y a = 768 Cages")
Det a etaaa? +P
= 721 C" yeen}o"!)
c
oO.Stuctuve,
Typedebi- “The Tupedelr ty wel to provide, allay names th the exising dato-tye
Syntari- — Typedelr olddata typename newdalatype, names
g:- Typedeb- aint Tdentitys
Identity Booktas
Sdenhty stds
he Maint)
oa Tok numba;
ypedey Hoot decal:
ctupedets char % String;
Dumba 5-34.56:
decimal 43
St¥ing SisS2463 =“abe"y
PE Clin shal oed", SizebC9,5);
pe Cinet.d" agents CK;
PE Cn aba "8", cyerb6s, 59;
KIRAN SIR
gach; op. a ak NOW WIT
* £ ope Santosh Technologies
i 6392345
%+ Redebine Py chore Cells 9245 3
Trypedels chad xcen+
Mlotd Malnc)
CR Pr PaiPas Htets veplated usith chez st
CR, Par Ps Po: |] Lis altos name “fe chars
4
HOC, Pi Pa Ps Pe ade pointers & Pa Ps aie numa Variables ,
chet & = Pr, Paks, Pe de char = Pate
% os below that amoy ts an homogeneous dupe tir lata it com bold anly same
ype ds Elements in odes to bid hettrogeneny type ob data we we structele
concept
x By using Shuctuies we Gin Create a wyex debined data types.
~ Te Psa ype collection abe Called as an agiegate data type 2% cefnpound
dotactype-
\
fr raabl. :
% rena Structwae 7s debined yjedeline a cem pound yostable dasoty fe
# anne fsacollection te one A more variable , possibility ohcubt.
, type grouped togetha Unde, a. Single name sx Cnvinient handlingsArioy pointers & otha struchates , uniory & enum, con alo be included
in Structde of q elements,
The indivicual members Can be orelinary variables, Anays, pointers, 3,
Othe stuchuers
& using Stuchde Ganion we can cease PX Gun datatypes ,
Syntari- Stuck )
X Create a structue catled 45 student?
4stdioshs
Struch Students wadebind datatype KIRAN SIR
t NOW WITH to ins
‘nt stds Technologies
‘osh 7
Chat * Snomes Sant 93246392345
Flood fees Cell:
us
Matnc)
ae able Dame
Shuck student sats
\ ; ;
PE cag dr Struthers siedsiee", sigesty (Sal) , Sige dd (Stu Student); I 5 ¢
pe Clents the data .... a's 9 Record
S# Claes she & Sat asi» Sal sSrame ASAe tees, |] Sa7% d1atecote™ erer.aeef
PRU In The cata es -— Ins
PLUM sessl¥ garcrd pSu2stneme ,Sod--eeg3y [net ewe oveyseom,
Qeteht ds
&
The sige the Struchae PS, otal membe elements th the struchia,
Structuiy con be debined tn ditt ways by IntHaliging jhe siucrwe
Nastabl es alto.
+ Struck Emp
a
Tne tes
chat now eL 30) 2
Tot sad 3
45Nota Matnd>
dip erseneas []tmvaltd Inc Cvaltd yarn c¥4
Stuck Emper, eres
stuck Emp 64 La aya"', avo | valid
eyetd ay
eqename 2Sabe"s || tovabid if away point OK
einame = abc; /]invaltd.
endtl = ipei3/ cable)
evr 6 ite
@3eSol = eirsoh-beassal;
%. Stuck Emp % Shuck emp
Tht tds, a :
chat nome [2635 nw tas
eee Chainame, [acd
aateate fiat say
us
typadeln struct Mmpoyee Emps
%
Sites da,imys", 200% ,e8% /lyes
Note mating?
M1 creres aie. btom global Vevable,
Struct employee Er,eressilye ore maunc 9
emp c4r05,c63 Nye Stuck emp 4,53 Ilys
Area yes are. local va's
any where any type t global vals contat ye10,
Nameless Structures 4—
rot a's,
x ae 2. Typedels struct
tnt ids Sretas
Games cho} nome. (201;
int sal eae [soll emp becomes alias name to the, Shuchsle
& everessilys EU
Void Maint ae Main)
d EMP cLeress /lys KIRAN SIR
Shuck 4655 ]|ng y Now WiTH tag
4 Santosh Technolo’ :
Debinea Structuie Inside the Maint) :- Gall: 9246392°
Noid Main
a
eal aoe i Elomenis not declatect
Ft thy Noid abc? Cuticle the Maly
choy enome (253; a
Int sols EMP e1, €21€3 3//n0
YEmPs /Iya
YunatnArray, br Structuves t=
Array, os Stuckey concept, inorder to Tmplement “to actey more thon one reco
7° toch: lei sigecty stvtchle 2100 29
Tot sls entatre, © Record: 12),
chon name (2c 5 emma Retort: 3h
Float Fee8 5 sey
3 ents then Retard: 14)
nt) Te
a > tre the 3 Rend 2 157
struct shident- StS3z ser8,
foe ts The Reaorttore > 131 clase SEEM
B Ter na, 969
alrsereas Isl dnithe “se95
pec'siae. sbruchwe: “hd -led", size) seo (Stnd studers))s
4dCI=05 1485 i+)
4 Cente, the oad Reco to" 402 \RAN SIR
is Clobdeleseg", & SEF 2st STi] -Srome , STIS + Fee); now wrigotoaies
Fe Chr Te Reade we = 09s santost arg392348 :
Forlizoy tenyiet? Gel® 92
pre shd-bs be \0F SLil-sid , $UI+Srame, SLIJ- fea):
gecho;
4%
then we wn THiS prgrm on Tusboc, Eaieh TE vases on ervor ob Hoafing
pl + toimass not linked» The compiles riot Supporting cthe. fun. 2, v8 hos to deting.
Hak ~ Hoot)
a
Hload- a, xbs
b=Gas
a= eb
4
Roe che. Some. cages ty which the “vebeience tp yhe Hloattsa bit absee 4
the compiles dagnet cletect the. need forthe enutateh Carp").
The most- Cammon 7S wying son) to stead a ‘loat ?a an ablay Or Shuthde = —
24 Sham cn 1 pgm.
we Con FEice “the format to be Linke by the using link -+loatl?. gun.
ik forces Itnising th the Hoosing— point Emuloth trie ay app". Thee tno
Need to Qald thts fun. swe Tnelucle. Whhe gver NeceHey tn Wr Pym, _
OUDynamically allocating Memory ‘for the Shuictures t=
“typerelr stouth —stuclent
@
int std
ched sname [200
Flea fees;
dsiel 5,
Maine)
cheer
pe clAliogate the Memory dynamfcabes... \n"> ;
do
o
S= (Sid %) malloc Csiged’(std));,
ifs == NOU
PE Cin memang not aUlocaded propos");
gecko;
Exit COd7
Fen entathe detsils ob “hd Record 453);
SH Caled p54 &LXS Jasid , S~>Sname , & >fee):
PEC In The details ob- wkd Records 775
PRC" hd oles elf ln, Said , (@s)-Srame , S~3 fees);
Tete
Free (50s
pe Cidew want to Create one more record CYIN?:
Ftlush (stdin);
opt =gelehar 002
Jildo
while Copt-==*y'|} opt =="y');
link ~ Float ()
zt
Floak a, x3
bekas
as xb
Ne
So, dynamically thae ts mo wastage ot memory [aco will not takaplace .Structures with Pn Stuctuives
One, Stuchne var+ acting aso membes, Element
te the another, s:
called as Shuchaes within Struchier ee
Unionst- Onion ts alto use, detined datatype Simla to Structures concept bud |
“they hove some dift's will be taxes place Huw Unions & structwes +
Every app” ats unions is possible in Structures bur Vice—Versa is not possible.
Syptar:. Union
4
Nembes - ele KIRAN SIR
Member — ele 2: NOW WITH
ar Santosh Technologies
Pee a: Pall: 9277392345
Se Struct S
3
\. intas
~ Plood bs x mem)
ghuct $ 5) 02125-5355; /alts
sen anion W.Uy = 13V,2-4sebs fever, rt
theay Cant initialize abate
Float bs
a3 deb = 242-365
rae pe’ Plo, Ub? =
Suc 8 gether;
a.
Union Ht, os
PE cstuchue : «fed ln, Sizecbes) )s/J¢
PECunion : a sien (4) 3 Jp
gecko;
&
The suede Shuclwe 15 ‘the “Total” member ~élemenks thr the stuchoe-
The Sues Union % the “Highat” memba - Elements wo The unvons -
momba she's aka time - but Sin
Tr Shuchae, we con inifiatige oll the
Js rok possible, 7a upfons ara time one Memory location uyed FS) only
Unions 71
one member Elements
+, NMelnt) 2G) g.chtll
shoushat| ]
zs
Skuta
teu
chad hz
43
Stuer a 27
Btasiy,
PF Clea") sizeo-Q)), 4
PRA ted sd Y, uot, EechU9} ,ErchOD) 3/1 siregvigy,
OMaint)
eT
es
7 [ioe [oto]
tne ts, ‘Z-chloS e-cbUi3
chor chi; lower bile Higher byte
PFC eled sigectoeay): IN
PEM date te, Bei Buch], 2-chLid)5 ]] st 98 98
X Tn what situations unions better to use redha than Struchires Con cept: ~
Applications obs Onions: —
Ff u Stove Employee Indo,
Highly scale sk
Semi scale ss
Ore woy to store Stucluvet . structures waiting 2 slots Eiths any 2 used bus
Not both then we can Storie. by Unions.
* uty
Name
Grade
Age
TL Grade = tsk
Hobbie Name
Cedit aud No.
TH Grade =ssis
Vehicle No.
Distance 4m company,
BO gtusk Sn
t
ches, hotbylict:
int credit nos [jens
a5
Struck nhoa,
Q
Chad veh :
ero, vehi [ems
4,
Tonplementing by unions we are
KIRAN SIR
ae oi ologies
tosh Techn
Soil: 9246392245
Onion tnfe
a
Stuck Tnboia s
Struck tngo2 6 >
4
Struck mp
oy name (20):
chor yade (42;
int age ;
Union info £5
ye
Saving nealy 12 byky dp Memery .
Mieburyne
Enumescation Cenumn) =
st tsako similarto use, cletined typa ; the Enumuotions membe Elements
aye Constant
By using enumoations we can debine not only member Elements rt 40
Kells what type ot data has tp hold.
Syntat!- enum Snumeasion—neme
Membe tle 4, Member = &le2 1 Nembe ~tles = .....+. Membuatle ns
oa
The Membed Elements tntanally accept Constant value ag an integer, Do's, Enumelcion
make the pig mere readable.
Enum BO0L
ie
Tue
ws
% Enum will accept Series go Intega constant.
4 FETS an alias +o Tateges
x Sige or Enum 7s 2 bytes
% Through Enum we Con genaate Seria ct integer constants.
+ Major Menu, based prgmng will be taxes place the Enumeations.
x Enum color Led, blue, white, yellows 5, green 4s
color S35
SE geen Kinan SB ;
Estatorh > Nor achnolont®
emer gantos? 976302349
Enum Color { BACK, WHITE, GREENG 5 Cells 9
enum color x4
PEC In eed « BLACK BLACK);
PEC Yn ckd WHITE", WHITEY,
PEC in eied + GREEN" 6 REE!
pe Ch Selecta colo 1; ©: BLACK
sh Clkat, Bad; i wniTe
swotich (9 “GREEW
Selech a colo | 4.
Case BLACK: pF Cin BLACK ts. Selectedl'D5 break;
Core COHITES PFCIN WHITE fs selected!)3 leaky
ma GEREN? PR'in GREEN Ps selected"); break s
Te
WHITE TS selected.erm MONTH: LIANEL FEBIMARCH ===, peeks
enum DAY d ards Day— jan=at, noofy—clayy — Feb=28, nosty —day—Mateh= <4
Noid Moint)
a
Tink dot;
enum DAY dd 7
num MONTH mm;
Aine mm,
seotteh (uy)
Core DEC? dp+ = noth ~day~Nov!
4 case. 12% dp4 280;
OeProjeck n in Tockeied RueDy Dynamte Memory Allocation
ASWKT, sos Memory aUocations “thee.
Since, ak the. Hime ot- Compilation only we have 40 debine the Size betore Execatign
Ob the pgm. for thts Yeauon. Eithe we can't MA dee the sige
allocate. the. Memory at the time of Exeusttion
Memory Concepls~ what ae the Tmemery we allocated by the. dynamic
it will be allocated trom Heap area.
% Stack Vs Heap allocation?
The Memo allocated ints Stack hat uniaue name & adrs, therctore memory
location can be accened by wame or through adrs.
The Memory allocated inis heap dog not contain a name , instead comtatns only
‘the Starting achs de the memory allocated ,thevetore can be accated through thicacks,
‘The memory allocated through Heap can be local & global es pective te its Auatal deb?
Le memory allocated as global then tha im
fun: by locating its ads «
Tn static Memory location “the: memory is allocated & feed by System,
3 dynamic, memory atlecatton it ts the Tick sb the. prgmy.
To allocate. the. memory dlynamteatly we hove sepatate fun's like matlocc?,
Calls 1), & veatloc (9,
fordeallocion we have -Hee(rtun.
All this furls Yetum type ts voTA
Tn RER'c eka type is chat x.
Mallee C):- sed to allocate eauived no: sh byte In memay at vunHmes 76
AK one arg. Ves Sige th bytes to be atlocaied.
Syntant- — Vetd malloc (Sige—t sige) s
1S @ unagtage vt Memory blrckg, _)
Thoda ty ~
with the sue we veauive Ob dynamic ~
memory concept 7
emong can be acecped througha diks.
iC vote.)
Pointer -Vok = Ctype cast) matloc Csigestcsize))
Si¥e-t ts eautvalent to the Unsignect int dota ctype molec!) cam allocate a
man tr 64 Kb.
Be A> Ente) mallee. (493
4 18 the sige. Cin byt) to memmy tb be allocare d
Coble): Used to allocate Yeendied no. bytes 1p memery ad aunttme. at
needs +0 ang!s vig: 1+ total m0 & dosa a sige of Bach dota .
Syntaai- Yotd-~ calloc (sige -tnmemb, Stat sia;
Guta
= (Int) colloe (8, Sigecb Cnty) 5
Hae, sigedtr tndicats the sige vir the datatype & 3 indicate that eve wand to
Teserve Space fox Stoving & integers.
collcc provides 2 aig's nttemt & Side the padomets nitem specifies 70+ 56°
+Himey to allocate & sige specifiy the Side oir Bach Mun:
for &g+ to allocate 10 Integers.
ary = Cinkx>cabtoc Cr, sigerts cinta);
“Tre fans Catloc allocokg a blk ob Side [nttems x Sige).
% WAP which allocate the memeny dynamrastty trey create dynamic Single dimension
avroy.
Ea)
Notet- The diff's && matloc 0 Callocl); Madoc abter atlocating
the mere
Th allocaies gatbaye valuity: Coulee () alloraty gels.
cone
Marac.
pesees oe
Tob xan, 1; laren
chyseveoy
PEC" Eni nowt Clements), Hea, aks
s& Uofed me soe
1) meenowy allocation data
a= Gntx) cabloc Cn,siae tb Cnt), 2 2d
UM accep tog Textarea | —o
pe Cerda. Elements + \p''3:
sorUI=05 j2n5 Fe4) 7
SF CMoled", ati); KIRAN SIR
logic. ow with 40:
Alogi chnoloses
Santosh Te" iS
[display 2925
Cells Se
“for Ciz0; ieny 144)
PR Cre Ve) xcaviy),
gotcha;
q.
The pointy vad+ cloerrlt Know what type. tb Elements TE ts pointing & How
Mon} Clements * 15 pointing .
The majoy ditt. He stastc & dynamic memory #8, Foy static 94¢ will be
memory Sige will be debined ab Rxewtron
But memory allscation -f beth always,
desired Compilation time, dynamic
time. Exeuetion Hime only.*
Dynamic &D- annoy 3
Maine).
t
tnt AKC TSS
chscxt
PE Cente the Rows colse!!)+
PORT eRe
St Clafed soa ry, Be)
How Mem
A= Cink x¥*)mabloc C-+% SigetsCint))s
Meal Mesnony
Forttaorier, 744)
a = (nt »)malloc Cer sizesbcinty):
a
Pt Cente the valueintly,
ctor Lia0; fets Te4)
a poe
for (Ja05 Jee 5t)
st Cojed", x carrey iz M AN SIR S
NO’ ogi
4 "9: AS
(nn santosh 7392349
ae Ds vers 44) Gell 9249
For C504 gee
pe Choe -ad", x Car 45))5
%
Forctsos Tev5 F44)
a
free Cxca4t))t
OLit= nulls
tee (ad)
asnully
Qetcht);
§
prginon dynamic memory dy allocating ‘or each vow ait. column valu ~
Maine
a
Tot HX HAE, SZ
clysert) 5
PE Clerks the, moot meas")
St Uhh" avs
Late
D
OK
uAra) memany fox hekeog, eclvolaues
C= Clint x) madlac C rx sigeshciat));
forCP=03 fers TH+
Qe
PE CEnks no-cd Cols for rows )eds'5T9;
SF Copa", cats
Ge Cinkxndmabos Cr sizer ns
fore 105 3275 74-4)
olf
2
deat = Cink Imauloc Cx Cort ¥ Sigeter Cintd)
&
A recep ting
Pt Center the valug tin! 27
yewhueyr;
we whees Ota;
est t=05 erst)
d
4265
orl feos Jen Ceri93 S44) + 1000
at
qotoxy (21492 Poe
St Coba", Xcatitt2
aeatas
Bess OB! Enter nos ob rows <3
aes Enta no & cls for wwo t 4
PE Cintn Given yabies ehy): a
Y= whaeylrs a2
K=wheex Orgs Ents the value
Forlico y texte) ES omen
a 2365
a Given vals:
Aforizos Sex Cont) 5 $449 eet ia
2 34
gphoyy Cay? a 6
pacind’, xCxCatir4s -
s
AEAth! KIRAN SIR
4 : sogies
tts tee’ ‘
4 Sant’ 92345
guchO;
%Realloc O:-
THis fun-% used to Tncrenge & decsease the sige ob any dynamic memary
which is, aMocateA using malloc (7 & calla) turls»
Sytaei- ord realloc Cuoid ptr; sige & new sie).
The sS*axg. ‘pty! #8. pty Ie the memory previously allocated by the. malloc d
Calo fun.
He. 2%aig. ‘new sige! 8s the Sige th byte, tha naw memory region to be alloasteh
by reabloct) +
TRisvalue can be lage Asmat. than previously autocated memory The realloct)
fun adjusts the old memoy region i# size is small tham the sige de dA memory «
SF the nee sige 15 ledge than the Existing memory side, 1 484 -tHe gae
copying the contents ot old memmry Tegion “bnew memory region. The funs deatlgate
the Old memory eQion» yealloc (2 fun: is helptuk fr managing a cynamic 2
avoy whose Sye may change curing Execution. 3
for &x's cb vealloct) yer websi fe.
free (2:-
The free ¢> fan. clealloaates the memory a3 pa the dynamic memory
deallocation will mot taku plac until the usa explicity cleatlocate .
Note:: LT the wernt cleatlocated when the Byptem shuislown it will be
deallocated ,
Syptax:- free Cpaintu var) ;
gor~ Macias .
“The C prepweeyor ts a pigs that procees our source pigm bebore tt ts
Paited 40 the Compiler, This MACtos ts one. type ot lang-whtch TS avarlal
A hteh 1) ble
mastty
Features tr C preprocenors:—
The C pig involve so many stages 4m the Stage ole coriting ac Prgm othe
Stage oe gelting exeenied .
“The proceyors used tn the Execution to C pregin ade,
IText eat —g preprocesso” compiler later.
Preprocexoy directives ates
\sMacro expansion ati tncluslon
B> Conditional Compilation Ae Miscellaneous ditectivese
1+Macro Expansion t-
cin this Maco Eypansion diech¥S we mostly use one tyP-Ob* mario ine: deleting
Rderine ts a preprocessor directive which Ts created bebo Compilation stmiSs The
didebine Gan be used in ways,
O> Togeneiate Constants
sidebine 410
The lebt stle caill be replaced sith Right side, inplace ob “4 Everytime “Ie! will be
Replaced & Sulbstitabed -
XK sedebine, A 10 - ote
Void Maint) pee to R
zu Void M
Tot fs bees KIRAN
Te AS wae w
5 \ = 10! cnn
pe chedste, fas Fe tatwa’yiney, Santos x3
4 4 cells 924°
%- tedebine sige. 10
Hlebine TSEMPTY top NOLL
@ Te ts wed to provele alfos naene for Existing datatypes &tun!s-
X- edebine Le Long fot
Abdekine pF printf
Th algo Provides some names th obliges -for Opdatms oko.
Av akdebine ANo&
Ae olebine OR |]B+ HES used 48 code veplacemenls.
‘Te Malros dain be debined with adg's alyy ,
#: tedebine mul (ab)axb
Void maine)
foi
Te MOL (218):
PE Coeds is
fe MOL C243, 2493
PCa ry
4
Op 6
& tedebine mulcarhea) xCb)
Votd Maine )
S
Same.os above
4
Testing tb the Macs -
Replacement»,
Nofd Maint)
lok is
Pe 243
PRCA 79s
Ps 243%243)
PreMed WT ys
4
Replacement +.
Noid maint)
a
ink ts,
T= Goxcar HC
PR Cake 725
Pe CAKE:
PR Chea" as
%
A Maco conbe tated 'y saving The pgm in the slw folds,
cAMe\ bin\ file names
abe Saving the ile god the Dos prompt, cx\clbin-
Gs\ TORBOCZ Sepp mC
D cpp-> Crepoceu
sEntunally tntamediate ade 7 geneaied>
Gr THRBOCA > type mel
Abid Malnt )
: KIRAN SIR
‘NOW WITH 7
4. Santosh Technologies
ened a Calls 924 3392345
duking AND,
Maint)
tnt 0 =80s
i® C @pANae)
PEM within Rangel)’
else
PEt out cbr Rangell):
4
Cow
UuUok
uu"
OzoneHe dewne sige 100
vord Mato) Replacernent:.
Noid Maint)
Jota; dea
a a= 44100;
pFcieled sted 4, Si3@,Q)2 pe clbudekd "100,05
: y
+ exo, cnsink nds not te4
HK. Aedebine size a
Nord maine)
t
Tob as
a= 100 asttas
a> +tSiazes pe Cll ded Facade
pe Cid bet “sige >|] 1-10) 4
&
Macros More than One [ine or Stmis:-
Macro's can be debtned meme than gne line when you debining in more
than one line ob sit: we have to end the every tine cotth “backslash”.
HE desing PRINTED ¢\
dor CIEI3 e735 T+4)\
2\
dovi5= 6 54275 Se)
pe 0°95)
cov (Sey Jeri S40) s
Creo cds 7
rt Cyn \ wee ce oste®
pee
Dp
®
Ak
&
hae CHR
age FREER
Hae RRR EK
Int hss
clysere >;
PRINT C6,%x!9;
PRINT C5, py;
Qechor;
8 Re in
Macidls & tus: ae
Rdebioe sumiay ary
fd raing a iis;
ee pects! 93[s0 seloros
‘int s3 y PEC ad 595
Ss SumC10,20) 5 9)%& Int SumCintx tty)
Tetarn 2445;
4
Note Marac) »
Tots:
S= Sum cio,20);
PEC 8,595 130
s
ditft's ty Macro® furs:
Macros ae like furls bu thee ts diff. bho those nwo,
I+ Tn Macro cath the preprocexoy replaces the mac template wt
Hs mane Expag
whee ag tn Rens call the contrl is payed +a tune eong with certain ar6's some
farls osc pebormed nthe fan. & a usebul value ts retuned back dun the Sune
3 Macros make the prgm wun fasta bub 48 the prgm siae, Wheeas furs make
The prgm smalls & compact jer ib the moor #5 ured 100 time fa the pram,
the macro Expansion gna tnto Sure code FR 100 mex which T% the pgm size,
Othawise if the fun. is used foo time in the Pram am diff. placg te takes
BME amount ob Space -
En the urls wohtle poustng the atg!s to oun. & getting back the returned
Value cloaddt take time & Slow clown the. pygms whee ay in macros this pYbIm
won't occetrs since they have already been Expanded & placed #7 the Source code
Deboie Compilation.
&- File Taelustons -
aeinclude, Tats directive Carse one Hle to be trelucld tm anotha. The
Prepraceitoy cmd tov file Fneltuon IS, FIndude “HrlemameY, “This oma taserts
the Entie contents op filename into the Source code at that pt. tn the prgm.
THis file Tacbusion preprocetoy ts used IN & casy they ale-
\e FE ‘the pigm ts very laige the code 1s deutdel into several litt. tle,
Each contafning a set or velated fun's thee file incution preproceroy ts cued.
‘Tae Higare freluded at the begining ar main prgm-
42+ dusls & mane debs ore needed fa Many Prams Commonly. arn such _
SPtuations these commonly used fun ¯o debs are stored tna Aries thet
Pele can be Tnetuded in Every prgM. This will add alt the stmnk. tr this
file fe prgm whrch fs mitten. In prgmng genaally file ate Meluded with =
the &xtensoneh » this Extension stand td ‘ beaderfile'. Tt contairy
Stmis which when included go to the head o> pgm. .x
The ade Q ways to corite HIncuide stmt.
They ole akinclude “Filename,
dhinclucle < filename>.
The. dit? blw thac 2 Stmis fs a4 Shown below,
when u place In <> TE check the tle only in the slw directys tees
are\inede, Te doun't checks any local clivectorige if u place in “1 Fist
te chechy the siw clivectng If Tt 15 not available then it ge th the fecal
dlivectovias
Example On tile Tnetusion: -
Zsidforh>
deine begin. maint
Ye aetine prinkted pant C927 KIRAN SIR
Gydebine end getehers NOW WITH
% . Santosh Technologies
Aadebine names Cell: 9245392345
Hh debine charackt chad,
at debine prntint Ca? pantt Chlea a2
Adebine veadink (a) stony Cold") Rade
Hdebine printchasCa? prints Clete a0,
cave the le) witheh extension, open a nee tile,
c2\ Algec.
aitinclude * e+ \algec"
begin
nemban,
chaacta 5
print Centacay yale)
read zat Cn)
cans
pitot Caiven vale :)
print taken)
printehaace)
énd+
Conditional Compilation. FE NSA gt type ob mace
compilation ode, presen in order to vedluce the code a Ere
Simi we ose. thts Conc\ttionad compilations.
gg ARIE abide
Akelse — dkundeb- --- - F1C+
Syntaxi- — teitdely Matoname
Stmth;
stmt 2;
‘Stmt 5,
ae endif 5
substitute the bebe file Save as
as ditts typs o conditional
eutive Belg & otheEgi- atdebine pe printtr
Nota malnt)
Ere tell
pee ly
pRchetyy
He End if
Pe Cite”),
% dep: Atiello
yinant 5)*
now we
sc)
tosh To
sang)
t ogies
49
@392°
cell® 2m
when u, working ustth this ” dition ‘the the
nie this preprocenior depencl on the condition it dectde either
code need to: nots Tris ‘Ong duce, m
xeaste & FS type oe conditi MACOS ae COM YE: ge te
yj i
the Sxeustable tile.
SaisFied > Compited
oid Maine)
te Ctlelig");
RIE Si aso
pecans
pe c'BYs,
ft else
proiy;
pec'yS;
Be ena
p&cluelaome!');
4
gig: HelloAB weleame
Aededine PF printtr
agdetine TEST
Nid maint)
x
Secreto:
aelfder Test
peda,
PES Bs
ae ends
pte Cuvelcome!')
4
le ellonBweloome
*
aH Unde :~ By uting sHundelr wut com clase the
Tek Sadelshied ~% not Compiled
Noid matnc)
t
pe cl tele:
ide Test
pecans
PEC BD:
Arendt
pe chweltome'?;
ofg:, Hello welcome.
saghen we. compiling inside The TEST desining,
damit clounle sxeeateds gust 11Ke a cmolt the Shmis
are Skipping.
Eitdeb) macro compilation -fime will save
wusey Hlexibil'Hey
By wsing this
scape om Existing debfna
mado.Ke edebine A 10
aedebine pF printf
Notd Maint) foayeecy
' Void maine) °
pe cata AD; IIb PR Clehal
seundeb 4 ants; :
Aedebine A 20 a
pe Cieha"y #9; Jao a ‘ Y ie
Arundel 4 ¢ ae
PECKob AD; [] Onoy, cog ot without eee
y debining oe Macro. F astec A
4+ Miscellaneous divectives :_
Besa, func) tnstde the main, dad's y ro ete,
AE pragma > This divective will be ted t\ onl ott options
“Tis will be worms depends on the editors.
J] supress Wnleaningg, .
SE pragma, wan! /Pretuin value
i pragma, wan — pea /] paramety not wed
HH pragma wan~veh]] umeachable cocle
Ent #10?
Seass:
ota te. Cink x)
KIRAN SIR
NOW WITH
Santosh Technologies
Gell: 9246392345
de eltaside fale";
4
jot 20)
Tot res:
eben 1
att
%
vord male)
hos
fH:
tau;
4.
at erver-- To meate. enor msgs.Graphics
Th orded to work with graphics first we have to convat ints graphics.
The giaphics Eeuttronment will Support both the CUT & GOT.
“Fo comet -# GUT we have to toitiate the graphics System by initiate graph
Goitgaagh Caraphic Drive, graphic mode, patty):
‘optional,
The qaphic dnives detect what type cr adopir prank In Ursytten + The
nivers com be CGA, MEG‘, EGA --- ete-
The gpaphte moder will depend on the drivers they supports diff - type wo
pixels depends on the moder
The path dy the fle tndfeade Supporting guiphics file System.
BGI > Boreland Graphic Intebace
call tell Bar ~> To inset les or anytring keyedon graphics:
WAP +40 find gk Whak type ob tive: Ts Present in Uy Systern & How many
Pixels iE is Supporting .
ns KIRAN Sik
gar NOW wiTH
ie ocd Santosh Techne's
nk gd = DETECT ,gmeos Cell: 9245392345
Toregraph (Aga, &gm, Neel tell bgil'as
Pettoled sled, germarat? , geb many),
SeroKtsloxter; // baanground
as oun:
a 1 Greate ciagorol Ine let, 51 444
Rectangle. C350, 220, UID, $907; [I Rectendle,
clean device (3; H entle.
qreie C308, 30/3; fl circle.
A PRC bette! 3
seks dextdivie CL, HORE = IR, #2)
ubterhay Cite, 50," GRAPHICS)"
Qeatehe;
close grapht>, [] To close the graphics paar
4Xgraphics sh> —
Manu
a .
Ink gd = DETECT, am=o,1)
tritgiaph Clugd ,&agm , “erih tell bgity:
SOK color 42;
while C Lebhiteo)
Forlaon tee loo ygt+)
t
Sekesloy Crandom ci;
Circle Capo, 200/175
dday ror,
eo
3
getehd is
clesegiaphey;
7 KIRAN SIR
NOW WITH
Santosh Technologies
Cell: 9245392345FILES
Many opps year the inky: 10 be coritten “to of read 4m an ausildey memory -
device. Such inte 7s Stored! on memory device Tn the -form ot data ile.
Dosa File allows “jo stove into. PAmanently & acces! able that Trp. whenaves
Hecesgaay.
“Thoe ae 2 diff. types tr data filer. They ate,
Stream Criented vy Stondasd dasedils.
System Oriente or low level dasa files.
Thon ode numeous librory uns avallahle for To: Tae ore cabegeorized
Goto three +
Q- Console lo fun's:, furls 4o tecieve “IP am Keyboad & wmite olp to VDO
b- Disk Tlo fun's:. fan's +o poborm tio operations on a floppy disk & hatd.ctitck,
C- Port 210 fun's:. furls te pebowm lo opelotions on waripus forts -
Conssie Overted apps aboayp, use the terminal, Creyboadd & screen asthe target
place. Ti coorFs Fine ag long 9 the dato 7s small. tpweve, many reatIrfe poblms
Snvolve large volumes b- data & such Situations »
The Console oriented lp opeations pose too major prblms.
Jo Tk becomes CambesOrme & Frne. consuming to handle lege. welums ah dada tnoygh
tominaly.
d+ The. Emin dota, 75 lost cohen eithey the pgm is termtnaded oF the Computes
Furned irs
ie ts “theebne neceiary -p have a move. Hexbvle approach whee dota can
Stomd on'atsxs & yead wheneve necessary, uaithout destroying the data- This methah
Emplorp the creep str files to store dasa
Dekivition bo File $~
A Pile 1s a plate on ‘the cl
A File 15 a colle.ction cbr yased doko.
Stream Oriented data-fles are nothing
isk whee a group oo vyelated data ts Strred
Stow tn a ponttculax area on the dfs h~
but high level xlo Fie.
pisk zlo
Highlevel alee] -
“Text Birary
Text > +6) 4 OPP, STL Ase a
anon sob} 1 #€xe , *H00V , “MPS
fomatted Ch towmatted (nt ame tatAll Kinds eb Multimedia file ase Binary. section, o
“The Stream Oriented clatafiler are Sepadated inte Text Files 4 Binary fle.
Text files are devided Trio formatted & Unformatted,
Stream Orviented datafile, are Sub divicled Into g Caregeorics,
“Text files Consisting wt conseautive chas's , These chos's con be Trrtapretened
Etthe by the partfculas Mbrary ~fun's used to transtes the Info. a by fovmat
Specitestions within the library tun's,
Thee chals can be tnterpretened a3 in divictiat items ems
, 5 clos
Strings A aumbers. eee
Unformatted datafile —> ft ovganigs data rnto blocks Containing conditions
loyts sh tabO- The blocks represen move Complea data Stuchae Such o3 an
array & Structuves, To proces stream Oriented datafiles a Separate Set vr
IMhrary farls are used +
The System Ortented data files more closely related te the computa as.
“They ade much Complfeated to work upon but more Etpfcient for Certain appls.
Separate Sel3 vr procedures with acagm parying fibrany tun's ae required.
Opening ty a tile?
when, we wont to peborm any opeations on a Files we must peborm ob-
opeaing tho file -
“The. first step ino. Stream Ontented clodatiles isto ggtablish the bubbel atea,
‘the buthers dy bute area rs the Semporary Storage which ts used while ithe
Tofo- 7s being transterred plw the computer memory & dotasiles-
To Establish the bubbet aa we hove to usa Keywood & “FILE.
FETS. built th the Stuctwe which tnckiles the ya's which cam vebea the
bNibale ah the files “IE 15 used tpvepresent the file pointer objects,
Typedelr struct {
a Shot levels KIRAN SIR ;
ae Unsigned Flags; aa yroioies
Hem hes gay Santor 7463929"
unsigned ches helas, cell: ©
Shenk bsige;
unsigned chat xbuthe, x cones
ars.grd — tetemps
Short tokens
FILE ;KIRAN SIR
Syotar:— FILE x-file- pointers NOW WITH
Santosh Technologies
FILE xtps Cell: 9246392345
ile— points = topen (ilename, filetype):
The File type inelicate, what type Gr opsotions we ae petoming on a tile,
Bosically They ae cabled a; modes cb the, file (atti bute).
%S seorche, file. TF the File Extsig loads tk foto mremony & SUS 2p a porte
ic] st tnt.
thich patos to the chan tne, i#-le. cloanle exist sh vehemns ull opeations
Possible reading 4m a file.
7 SC Searches file. 4 the file Exisis U5 contents ane overwritten EE tile docmn'e
MISH new file 18 created. Rekans null # unable te open atile. Opdations possible
wortting “to a. filee
“o" seosche fle. Th the file @xisis loads it trip momory & sdsup a. pty TP point
he first chat. tt file doesnt eafsts new file Is created: Refuyns awl te unable ty
Open a files Operations possible, Appending new Contents at the entob fle, 3
“ex” searches tile. TP Tt Ealsis, loads t+ Porto memniny Setup a pty whith pointy the,
Fisst Chad fntt. TE doesnot Exist Pe vetuins NLL, Opeiations possible reading,
wori¥ing, modifying Existing Contents.
Wt at, abt---- Etc.
File Operations:~
functions: felasee) gel) tread) -fayttel? #€0RC)
Premovet) gett) Fpantic) Feexts rename
constant Gatetype & Gloleal vestables »
\e BOF B+ SEEK -COR
cfopenta fsconir ()
geteharc) fpubecy tell)
B- FILE 4eSEER-END Ss MULL 6+ SEEK-SeT
4% WAP 4p-read the contents 4m the file & display on the Screen.
Maine)
FILE xfp5
chon Frame (643 chy
pals Cente the le name>,
gets Creme;
tee open (Fnaume "35
it Cpe Nv
GOLq
ua
PEC tle not ~focand"):
gechor:
Exeter;
&
Pec’ in File ts present & the contents are---.\n!'2:
white
de fge< fp)
Hf Cch== EOF)
break 5
parched Cech);
x KIRAN SIR
Pe Cin File Open succerpbubly')s NOW WITH
Felose Ctp); save a Santosh Technologies
gaeher ; Cell: 9246392345
oe File as pr & the contents are
Tits 6 a data
File open Success ,
Creating @ Files
Maint)
t
FILE ¥SP3
cha frame Tex], ch;
pals Centar the ile same'!);
gets Crome);
Sp= Fopen Cframe, “i"'):
if Csp==now)
en "
pe e' File not Created”).
geiehtr:
Exiewor;
4 a"
PEC Enka the contents onto the ile) cntil preys Fe~ ~~ |",
while cr)
a
ch= gelehaxcys
Fputc Cch,Sp);
x
PE Cin File Created Succeypbully) +
‘elose C3095 [] save 05 “
getehe>;
%*% To add sone moe contents ort the ile Use Append mode,
89 = fogen (fname Na";
“Toe append mode wil) add the Content 4m End the -the 4ile.
& Fpude () Tk vedirects a Single chat. fo the standaid tile.
Fpte. Coho, Flex;
% fgekeC) tends q single char. intoa tolge Vod+ from a Specified -Ae»
char > =-fgete (file *)5
Ae The tpascd) & fgetcl? maxes you -to move from one, chad to another positon .
& WAP 4 delete q file?
To delete a file we unlink (fname)
Matncy
d
FL fey
char, tame {263}
chserers
Purse Ertky, file name -to delete!) s
ges Crome); KIRAN SIR
NOW WITH
=fopen (Frame, "9+ |
ie Cpe Nuwt) e Santosh Technologie
tit Gell: 9246392345
pals ("File not present'D4,
gah os
exter;
dose;
unlink C-tname),
p= topen Crame, "+" 5 |) tor contitmation ob
4% Cfpa= now) fle deleting -y net.
puts Cin File celeted suceerybutls"),
Helose C4025
petehens,
ae Prey
Me Wapreada file 4m the tile display ao. a chars, atphabels, tg}
sidtorh> < process h>
Vota marae)
(Tabs--- ee.
4
FILE. 4PP3
chos frame (28), 6;
fab nese, nsas, Hbee, Ralee
Int nt=t, mel, #lageo!
chseres5
Peds CV enter the file nasnell?;
FES Crammed;fp = fopen Cfrawme '1"2;
it Cpe = nun)
a
Pe Cle not Created");
gerne:
exttcny
ahilecy,
4
ch= 4gac Cfo).
TEC #08 Cp)2-/] #Ceh== BOR)
break:
newts
1 Coho! a ches “Z| ch=3! && chen)
fakes
i® Cchaat 1)
een KIRAN SIR
an a NOW WITH ' .
them Santosh Technologies
Fecha in!) ogie
me Cell: 9246292345
WC chee!" |] chan! vt) [lches nD
Flag=t;
fe cHlagees RK chL= Wt Re ch =tyold cht =")
fwets
tlog=0;
i
pe Cin nib. tb-choss a efeet§ 002) 4 Eggi the lente
pe Cm no: nal = sted", nol ere
pe cin No: ats Spaces soled", ns) IIS
ph Chin node Tabs ~ sta", nty:I0
pEC'In nods tine = tha, abs 1)
spelose LEp)s PECIM node exc = ott"? lI4
gehts
&
fprinttO ond +scanf 0):
‘The genaal -komot 157 tnt: print C-£p, formats)
FILE 4tp:
The atl chol formas ;
e PEED places olp on the named olf 40 which the file pty tp poires,
Ss
“ePreseor the oN9'5 whose valuss ade printed. “formad 1S the dormock specttich
ae Gacty Same with fpriniel.$scantcrs-
TIERS ued to reditech ov accept the dota 4m the Standard file tay
Dven vootably.
Fscant C-+ite*, “atdentitios >", & variable).
Gs-0n Fpvinteco:
Nlotd maint)
tue *P5
Ak eno; :
chad ename (ashy
Flocd- sols
elrsereye
Fpatopen Cles\\ temps dat" "v9,
scone CFP Meld obs ht") Bene, ename , &sal);
PH Cm Enos sleet, enods
PR Cin Ename: tes! ename);
PRC'IN Soloay + o/s 26%, sal? -
Felose Cp);
gerehtr;
&.Random Accesss—
A File may be accened Seauentfally oy randomly. Ine SeaumHtal acces,
all the preceditag dada % acceyed bebme accening a specitic porion tb a file.
Random accex permtis divect acces toa Specifre portion tbatile.
Pecoxcd, teller, & vewtndt) ae the fun's used tr random accey ob a file,
Aseexcy:-
flag = fseex( Hle~ pty, eo$et from — whee):
fnt-flag ts the Value returned by the fun. fecexey iP succerdl & 4 16
Un succetytal --~
FseeKC) seis the position sirthe "nex tip & olp optiation" in the file toeohtch
‘the file pty fp points toe. The new positon tatthe signed distance cbtrer
byter: 4m the, begining, 4m the emt postion & 4m the End st the file cle 4
upon the value ot the pty Names a
feck Che, 44-0;
Position the file ayociased with tp Ol the eighh chanackt ot the fileCvem: =
the Ast chay. ts ab pesitiono)
©) sEEK-SET -> beaining position
Q) sEEK-coR > cnt "
(2 Seek ~END—> Ending ‘
fa ”
TR the 98 padamedr 761 the 2PA posameks Speci tie an Tor Unt to the
crnt position Os the FILE.
> focor, CAP, BL cKaps ahead 3 challs in the file whaas move back 5 chy,
> Fseek (Fp, -3t1 19
*° a Emp table we neck fo zetvieve the sh veer for this ore we use f9eeK) tune
Shuck Emp
Jot eno;
6
chad ename C203; {~~
Hood sad:
w seen (Sp, cld-1)*sigeole OP), SEEK -SET);
id= st ye
o~as > Steed i: a * =
= hee
eas on TEE tn tmp: table thee we veer! then the last vecod &,
s2-n > x
ae peng at fecex, Cp, ~ syed CEMP), SEEK END):
104 ~ pe > st2% WAP accept 2 chaxs yeplace the first chad with 24 char. trom the #ilec):
magne)
t
FILE *p3
char fname L201 chi, che ch;
clisexea;
puts C’entr the file namely:
gets Ctrame):
Pe Chante the fixct chaas's
£Fluyh stdin);
chiz gatharc; KIR RAN SIR
ph Clemter the 24 chat :!), ea schnolosie®
Pflugh Cstdind; santosh 3392349
=getcharer, Cell? 9249
Fp= open frame, Nya!)
Tt Cép== Now)
a
PE CTRILE Not present 2;
getehon;
Exit);
while ci)
he gee (Fp)
ik Cch== FOF)
break
if Coh==chi)
Fieen (£p, -1, Seex coe;
FRE CMD, Molec! chads
Hee CARLO, Seek — COR;
-felose Cty);
gach;
4%.
HE Wlne accept a file veplace the fle contain!
Mott)
a
FILE ¥FP5
chad frame.(s83,chy
clasere,
pois Cente, the. ile name"):
get5 Chrome) ;
ing dtr lower to upper & vicevergq.
GotpC Eenics the chas'd;
offlatah Corelind;
1# Coh>agshdche= 90)
a
seek (4P>~1, SEEK CORY,
pt Cépyteire" chy22)s
seen C-£p10, SEER COP),
Else
ie Gh peat &&che= 22)
Faces Cte, 1, Seek GoR?;
FPECHY, Molec", Ches2?:
Facek C4, 0, SEER- CORD?
u
close C#p); KIRAN SIR
geteher; NOW WITH
% Santosh Technologies
drawbacks os fprintte) & fscankt> ; - Cell: 9246392345
Struck Emp
i
Fok eno;
chad ename [263
Float sal:
a5
Emp es "
Eph CAP Meld oles eledy @r7d, Crename, eesal?;
we can uorite this bub te % nob Tecommandatle
cin qris Situadion if We want to make any modification then we need
“tp create 0 temporary file & copy ‘his one & make change £once agatn
copteh Into this one.
-feowitel>:-
Tt ts wed * vediyect the Cmplt object o& a ShUCtue into the binary file
tuwrite Co &object>, sige, Vtile ¥9>
shorite, Che, sgevdCe) , 4p);
A-indicate. noth reads Se—Source fp — Jaaget
ae Unieneney clr memeny atloction then we goth funste (duns
Tt ts wed +o read the data 4m the binary tile tte Struchue obset
ustth a Known Sige.
Head (iim < dobjeck>, sige .1, file #9;
fread (&e, Staeab- (2? Lp):
Tt is wed to rad the. Eniive record odo. mes€q- On funrttec) & fread: —
Struck emp
a
nt Enos
haa eramelzol:
Floot sal KIRAN SIR
33 NOW W:TH
vord ron Santosh Technologies
FILE. ¥fPs : 3 5
eee Cell: 9245392345
chod chs
elesere2s
pa -topen Cee v®mp tetas", apy:
do :
CY ent. nos"
Stetelecl Ler eno):
pe Clentear enamé?;
Hugh Cstdind »
gels Ces ename):
Ph Centar solary "2:
SH Chats My kerSa?;
chorite (he, Saecble?, Ip):
pe Clreand. Saved suscerbubly';
PE CIN ent another record Cyn Ts
ftlagh Csidin)
stctbe", keh;
Bile Cohy a tints
see. C-41:0107: /} Reacting & clisplers
PE clos —josel+ “ISS %S!) "Enb!,""e.name' " sacaey!):
ph din 2. 2s °
Prod C&e, sgechte?, I-Fps
while C1 tor C#99
t. Cin ele Ina els “17S 2h +2F4 ev eno, e+ ename , €+ Sal);
fad Che, sizevt- ©), 4p)
3
felore Cp);
gelehty,
t.
om
GCommand line arguments : -
Powing Some aig's +o the main & developing the ems ts nathfrg but
Cmd line aaa!s +
Mb tsa padareter Supplied TOA Prgm when the prgm ts Pnvokect
These ade the arg's paysed te the main ad cmd prompt»
String,
a
a ine
Tot magn Ciné argc, Ghar FOGVED sie olimengio® iQ -vectes.
Maint) fun. in c take & arg’s called age agy.
The tbo. Contained tM the ond argls, when main ts cabled up by the
Stream +
@YC% The wr ange tsanay. county that counts the nos ctr aag's on the cmd
lines
ORGY The av isan aig. vectR & reps an anayst- chod ptrs that poi
“b the crnd line aag's. The sige etravay will be eauad tparge.
% WAP implement a user detined emnd by pawing Some ara's tp main ota, Celle?
Ant magn Cit ange , chor xangv 01) Meonnening xe. tile intecmd .
fot mona
chod ops
1h Cange <4)
be Clin syntar ots cmd is tneorrech"?:
Exit Cory .
: AP: gx atte ott
opzangv fdG3 hn
P= actot (ogvld): Oma prompt Gan be Exeruted 4m the DOS abe,
a= ate? Congvit): selb- Run. ag!s.
~Sustich Cop) OxQVLED4 S.-W.) KALC + exe"
2 n argv Lid: 8c".
cone 4 pe Cinta mena) break; argv 023. 4"
cout! t pt Cin elsd’ym~ nas breaths orgy 153 ¢ tq",
case *': pC \n aba, pixna): break KIRAN SIR
cue Yt PEC In bd" m1 Jno breaks wow witl rl
7 ies
anelie!s pen old! nehnd: breaks: Santosh Technoles’ 5
Aebowt: phen tnvalid oped"): Cell: 9245392 °
4
Savethe. tile cuith any name tor Suppasc, Kaleec & geneiate an Sxeateble tile,
“Then go far the DOS pempt- Then wun the emd+ How +o do program in LiNox Cl edith)
Application —> pigmng —> Vii edith.
I nsi®
\Ri
Applicosion System tools —> Terminal. ‘ou wn tog
I+ first gop Kanal ob as gantosh T8° 50 as
Sloat -> Tamtnol . cell: 2 one
A+ AH opening Teumtnal Coma
" prompt) U see. ond
3+ Type $ vi filename.c. Pomp
4+ Then Opens vt éditcA. (notepad)
5+ prey" Inst! Button OT) and type bez write yorroode.
6~ Analy prey asc¢shift + we (Save and wut?
F- Then come cur trom vi ediites
8. Again ase 4 Cprompt?
4+ Type $ gee Hlenamesc Coompite) (Hee, tsex Prove thang I” premy)
Again “Type 4 fa cour CRON) KIRAN SIR
ousee the Result ob the h Techr
y! e oh the Pg. Santosh Technologies
Project " Trchniad peel: 9246392345
Pleas fi {ho :
° fits fe ub pranl Gop
http: [I KicanSrinivers Wdnew _ Com
Ee Tee °
lecheiol Bok Spach Bek ‘a dre kh
fe dak
SiR ‘ 7
Ke oles tm Wieasinhen 4
santosh 105392345 men
Cell: 92