Professional Documents
Culture Documents
Computer Printed Note C
Computer Printed Note C
48-57
Data Types. (Vtmp)s : 3 ATS/PR
Inc , data typec tells tha comprtle,> about the type
& nature of the conctart “to be istored “fn: variable»
ec of dete. typec are supported by Cc ach oft
be! vepresey Hin co% ss temoay:
haracter (char)
= Bovble (double )
~_Void type (vole es
‘qr et earad qa dae ait
TGR AIT AVIAN,
ae nNCIT Collegea
Lotege:
' s
{YPe ? one whole
Tp em quater
i Memo ey
numbers
2 ime
er “bytes Compton de
oon ~Spauifter nos d mpl —dependent) _
Rea;
aaa5 of preeysien
a8
te 34 x 10°
wee a4 x10
Float & 3
as 7.83
L tye’. =
Memosxy = 2 hytes =
44 dipits of precisron
Type quatifrer = double
Format specif en = she lt Ronoe =
S
dovble a;
| dovble 65
5 | Void type
id
Specify. o. itype: oft fiunetien :
soy. value: to \éauing, fiuncttoin, 1.
nL siuees
| D.PR._Signe: Sure deen
—_| 2 P_unsigned ie og eut
“31.=, Pepresen ts
| Xembers
“Hype quaufter Is signed
int ov int
=|by defulk au voles ove,
es unsigned
both tve & —ve represents +v2 nUmbay
signed. _
Ran,
2769 to 432263 |
Short int
EP double,grr Bart warn wa were ae
aera, AAT SVU
NCIT College
Vahiiable declatatin A vatiable init lization
int wells // vartable — ceclaxatren,
P| Naming © veniable along with ts deta tyes. fos
programming fe ented vor
We cannot use any. voxfeble fn the psopram without §
|declaxaking it before- _
eg:
fot voll 5
Soll ig a vouable. of type fotegen
well _con only store the integ valves only.
Voniable inflyifzaton i wee .
Assigning, any value Jota, Vvaxtab| fs “Kinovon: cus.
Nenioble ini i Nizatron: iTewite! 62 types: ‘ ee
DS: ic 2, wr
oritizh toni. sun Mneivfatttel atten
Compile time _initirzation ::
ep. inf aj. /f variable; declaration. jalitey
-compile Kme»
= 30; I vanidbleniittlizabionsets bab taret
print § Civatue fate igs ce Uo.) "9
D.volneief-o 18 wor si ortiini gucwy" Aes
int @sb 4 sel doses
Wz SOs. t “a 2 x 5
$= 60 ie i ig el 5 s
peinty Civalwe vfja fe Sid: and! valogio6 sb te Yod sad)
Votive of oy 16.S0 Land) oluen ef bb ts 6 :
UM Verh werd Cs Tae ae
egg. TEMG, ate WS MIAN
= : = NCIT College rSyntax:
Print i “content string "list of varncabtes) 5
| enteol ote ing. FAD MCE of charachers NOLON
oo Dtormat speufier [hd he,
— Slescape sequences [/\n 5 \k
laned Venable as!
Seant (format Specifren”, lietop Sddvess of'-variables )5
Seant (“fd Ba) ‘
G address of a
CRs. ‘ :
Noid mace ()
Tat xollnos 4
print ¢ _(“Enten. your voll na”) 5
Sean (2%! 4") Boling ds
Print § (“your rollno is at”
geteh () 5
roll no) 5
Yeidl main (:-)
fot aby
Priat$ (Enter io
seang.(" hd| print § ("A= yed and B zd", 9,b)3
geteh C) 3
output >|
Program to add, be numbers eee
void_main ( >
ir ; : Sree two oie.
int a, bssum'j » | reaute te ans ws
print ¢ (Enter. two numbers’) j ety ee
cant (Spedpa,&O,& bys ae
Som = oh b baad
printg: ((! Reco tits:
geteh C5
3
Siu hee Sos
coh ev Poth Reig Tb \ :
piiotg Enter three ge.valyes!’) i.
Stang (e/ed rad id) &PAAP LR) 5.
Eb = (PETA RI po biee. flog phials ee ‘
| __prints (“Required reevlt. Is. ed", Int )3
getch ¢ )3 es
5 : E 2 :
abeOperator (xmp)
TiAn cperater is a symbol that operates on certain daw
tapes ox data tlem. : et ees
~ Spemter is used fer axithmetre & lepfeat maniputertion.
[The deta tems that cperatoe ack upon axe called
Operands:
= An expression is the combinatton of Vexiables, cofisiants
pod operators, woxiten escadting te syntoxe mf lenpuage
ep. atb-5 S-} etc.
Types to be. classi 2 4
4)|0n_ the baats of ne. of operands. Sania
2)|0n the basrs of work eet rt eS
Alon the ,basis of no.ef operands
Saseentss at
-{Unawy “operatow i inkeo only. si
Qt? ena plus att,
sarees
eres:
ve Lcza
T 7 :
post predecremeént penate'yoperator ‘takes three operanels
_@>b) 2a ibs
-|on the basis of wove obit thy
4. Avith metic opexatox
2. Relatvonat, a —_
3-_Assigoment ” _
A. Logica’ openaroe
S- Increment / Decrement’ opencttor
E+ Conclitionat epenate + :
%. Shifting operctor
8. Specral operator Z in
1.| Arithmetic _vpexctto'r
+ path.
= > ach) wink Se foboeifete a :
Day * frrt_& Hoatiz float: +
KD ak we Float & tnt = Float
LD ath: float & float = floarbi ‘
fee 3d i ok
| Relational operator: i sie Shiga Sha
32528 32 225 ;
wie. uset. to compare two similax opexator , depending
Lupon #eisulte
-37+Ssignment- operator. ie
4 assign the, result pression to a Veway,
= Meaty done by.
2| a=b Gab
ot=b 9 az atb
—— 41 Lepicat_operater i
Logical AND > && oeConditional opekatey
expression £9 expression 2 2 expression _3
@ i —
v a
saue value false value
condition
Noid main (_).
fab int a,b, laxpe 3
pacot¢ (“ Enter. tics “numbexs”) 5
can (died Ria, & bs
toxpe = (arb) Parsb >,
print g (The gecalen | pombe, is Yod 2 I
getchl D3
Altemate
ivetd main (.) its
et
+39-B Special opehatoy
i comma cperater. (2).
| &S-fak_asb 5.
of op water CX)
seang (“4d 2 €a)s
rement / Pecrement opexatex
es ata
Bae +t > pre Increment _ t+ a=ata a
au=- ? post decrement. a> Dazaa
=O pre decrement Sree a=Q-3a)) int op 2Vame of x tg
pone
peint¢ Civalue of x ts ed) x5
Cinco teers —
paint ¢ “value of >¢ = e/ed & yard” 2 5y)5
e)| tok xay 5 =
*225 Ye> X23 & ¥=3
ye thx 5 5
print (xed & Paved y254)5'
d)| fot x2 25 - ~ ee YP P Value ‘of x=2
print te (value of x sch”, ett) 5 value of x=3
peiobh (“valeie of ves s/o! 30) 5
©)| jot x= 2! ; iyi
prot (fvalier of é 5) 5 XPD volue of x= 3
prints Covawie of fy -Value of x=3
p sta gay key
4) yerre oe 2) ysckex
NY i equivalent 40
- 2X DytS _ Me XtTD Xe S¢1=26
Ketl > &2 SF1=6 Y=x Dd gre
“ALed
8) yea--
Alp equivalent te
Psingg (“a atta);
Qeaa
prints (“azeed”, att)5 azn :
print (“a'atfed’? g 5 = :
getch (_) 3 :
= fai tightly
4)| x28 y i
et ee
Up equivalent to
Yr ty Bi BtSs Jo.
AE X41 | Sta=6
Xsxtt > 6+
2 | 5,4
Yo Ket Pett
Vy. inh KES Y
YE Xt tobe toot
AY equivatent to
ee
[xs era
X= RAD sea
Me xtd 2643
6 ȴ=9
*%| x=3,y : SE .
ye TE ee eH ot i
The equivalent expression. te Le
Bus xtra = 3t=4 5
td MkL=S ert ae :
YE Xt Ab At Xe = StStS HE = 29s
Ke xti = St1=6
ye x49 2 6t2S2
rl Xe 3%, YE 20.
ly
Ea int Yin Z =
yess zs 5 :
es Yih pe yt Re he
i 2 Soo ee ea2d 6t242 = Rs
& | Hepa eae hs :
porn Ze zds A122
td007 - Fall
Bea) What ore the fined values of ar bywancd x alter execution
of the felowing, stelements 2
ink 10,0 210 5B: Ab, 2
xt = Ha- ptt
The equivalent expression _f. bid 2
Qs oftsiotis 412, : TVD if ee
x = X+ (a-b) = 1o+(32-11) = 1040210
b = bt1 =41142= 22
Go}. (2a)__[a3}. fra].
z
x a 6
#42 Ye,
The “equivalent expression 1s
zis zfa = Bete 18
bis bok FAB ME thos ine
xe X— (27> b) Io (43 % a)
Pag bth x go
Tie teeters: tn Es 1s Aidit
& = o+1= i11¢1=12
aA x = = x¥* (atb*2) £8 ¥(aat11* 13) = 8 (124443) = 2aiss 209
Zs 2-1 i13-1=12
b= bri = tr. a2 2] [za] Jaa) Ted
a ete
“45-2o08- Fall
3-4) Given the code below coxile the output of the Pop re,
## include