0 ratings 0% found this document useful (0 votes) 24 views 12 pages Basics of C Programming
The document appears to be an introduction to programming concepts, focusing on various programming elements such as tokens, constants, operators, and assignment statements. It discusses the classification of constants, types of operators, and the syntax rules for identifiers in programming. Additionally, it covers logical expressions and the use of operators for manipulating data within a program.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Carousel Previous Carousel Next
Save Basics of c Programming For Later “Trveduction to Pragramesing i in
* rhs ieee ba nwa bye med
Dennis Bad rie Whe was workiag at AT&T
[To _the_ — “19 80.
—— ied te” ope
* Pie. rn lamang won reachine independent and vas
sk TH is also cabled gi Procedure, ~ Oriented §
Qs the focus in oo procedure Acdher shot, ala,
rata a uadlfons.
&|This functors con exces dodo Seely and can madi
ib.
xT} follows top=devn Approoch: of preqarom ing
Chosacky set of ¢
|
7
|
1
Follonrrg u the tit of chosackys hot con be sek while i
¥
toying stakemen jn _© programme. j
Alphabh CA-z 0-2) |
Digits C 0=4) :
\ als y I€Z CVC I 354
Constants |
Tokens: T+ ‘sts smelted individual unit of ¢
Which > Wed Os O pout of
ro
Scanned with CamScanner| i} kept
|
I I z
|
‘he tokens
ovo
oa Contant ities
Qprrators
Tdenttiers /vatable.
x). Special symbols
Tonstants |
[sabegral |
ioteger| . floting point |
4 Keyword
These
ox the tords nc - Programming thot hoy a pre-defwed
Iconing which Connod be changed. Tif, aves haste butldin
locks” of any ¢~ programme F
4) On leyuods mut be Leite in small case -letiers onl
KA keyword cannel be used 93 _yasiable name | ideatiSey
[or or" ony. othe. piunése,
4) auto, break | case) Char, conkoues ocefault , do double jel,
Sour
Blok, for gat i, tot, tong yetun —ciolie
st
+
ruck, suoitch , union | void hile.
x Wihers [Vouigble names
They
+29 sum
ve usew delved name: @ tbich are giv te variable,
nections and arraus.
%iscount, ete. Rell No, adauduld
Ti consti of stpurmee ot lathes or Sigh a> alphaloel
-Olusougs os a first name,
f——Lbut lower = case
he is
| I rarer
(eters ave _Commonty
32 Chouracttrs.
Scanned with CamScanneraT os
oud neh in the begining
_— — 8} Ne spacial syrobal ofl 4h
1) TA shout
re
Lethe _ appt or uit a
with on alphabet 7
case. - Digits cre permis
Lis AMowed as a pa of identifier _
1). Oppe= case and. tower = care letkrs cue _distact .
oS mstabt OS cnark 1 AS aaa D
— WM] Conclonke
Stokement s
tre coarse of ewerwhion.
Hl Constanh ave clanified
0, Numeic [in fecrat
Constooh tnad” condone a umercal Volue and ae
Sub __clousified as Inkge and floatag point
a) ateger _constan: Hs s 4 digits withou
a decimol fraction i eg 19,10, (00, -~-
») Fleating pont tonstan’ ove sequense_of digi i
having decioncd point and Pack part.
Cg: AY 2ST ssa, S443 7 ey
}
“ijl Chemaake Conan
Tt con be alphabel, ao digit OFS symbe) repro —
in _o pair of eyes }
Si Ns:
consist oF." eithiy a Sings —alphathel cx digit org
—Syenbal enclosech
within a — pare of Sing qyusks ——
wis eg. ‘Cc! ~O- Sd Hi
atte.
4
b) Shing Constante _—S
tt is o_gyoup of alphabets or digits ax_syb —
enclosed within pai ~ —
Poirot double quale
. oe uM io 8 7 4
eg. “dohn", “tara” “ance” “den
Scanned with CamScanner—_ & padres, optalers =!
a Spawn thasis 2
{YL braces S1 cla
LJ squave meawe a
AR Shor — mur lglications :
Operators : An -opuater is a symbel__thad guide
a 4o. poser Cudoin mecdhomatites
Oc. \ogi cas opuostons Gopencling upon. their
ose. .* Thay Ove _used fo manulpulok the
Roe ahicly isto Oy. an mpud from the user
ino _C__pregrame + They form povic building
block wot any erpression.
eqs Sum =atbe tits ok Lexpression'. consisting of ‘= ond
w+! ds opaal rs. whereas Sum, a ond bare viable
or oprants
T = vs On as ons
Pre number of opuars on tshich he _
Based upon
or. they ave si he.
Opaater __\e! "
Unaiy _Opaator — —_
Tt wow
eg: i++, {n=
%
Binary Opuotore
i ‘pas tsdrk upon two Opuonk od atime
arb,
22)
a [conditional Gpucctor wr?
a
Scanned with CamScannerOperecter
ou 4o_p form Vax'ous
Opucdtons on the __opuants.. “The
) Relationale Opeicrto rs
These Gpeators Owe Used _do_ relate or Com pore
two _opratart or quantities ond depencling
Ane vesult codain celecisions are been taken
‘They cue Bary -optiaters as they —Isork Upon
Opuants atoa_kme, *_expvessicn Contoing sel
ey: (a >= bn, (b==0 ) opens ox called yelakena!
repression —
They ave li cae as apeuctors Cs the
J
Produce only hwo results that is fous or false
CV or 6
loeolean
veloconal
Hinacebee vali as Logica
Nic OQpuctors
le \ogical AND &&
es log od OR M
eH Logicod Nt pens,
Scanned with CamScannerTalus Tike —“Felafioned op soles Tiga aaa
La abo catledov boolean © rs Ldhich
--preciuces oly tei results. ar true or false,
r ; ; , 5
E x pression Containing logical Opeiotor is called
as__logical __ ex pressian,
Logical ANO.=> T+ produces) ox true volue if and
lool iF at the relational expression Which are a
pat of the Logica ePpression - produce, a value
tvuo — Vouluen ae
|Sn core of logical og i veithe» wok the wel adional
@epress ion produce ao trun, value thon’ the. entire
Jogi cal ressI0n iM producen A
Por logical Not, yt is also called ais compliment
here was compliment is! 0 ond O's ho Hired te 4.
mp
Fissianysent ment Operator ¢=).
that” is; usedto. assign values or
pikes {o _Certain —_vanialbles Se _ identifiers.
ths 0. ssociativily is from plant to Leff as a
| yesult Quantities “Or voluay present on the _vight
cide of re _optator _qre__a.ssignb-tea \Vautebles
Present oo left side of te _opetater.
fin __exprassico containing Ossignmunt 0 C=
1s _Called_as__cass\ gnarl __¢nepression
ash
eq. Sum > Arb pee
$
eS ail
Scanned with CamScannerFelfotsing ave “jhe Fype__of — Assignrest
e
Chain AAssiqninent-
Th 1s __ used { assign the same Value +o 4uc
More Vautlables __or “identifiers.
Cy ind. 5 be
aro
boo Qseb=C 20
Cro VY ‘
oe
Net ausig.neeab Chain assignmert
2) Conppounch . Assi at
Ty a Tehand of ao rovmal Os ign
Cupresinn a0 can be used it and only” it
whe sare Vauiable_® Sepang, an _eitha si
ct Hee Ossignmat _ opuador.
eg) Sum = Sum +10
a>atb
Shs sumo br ohana a, Com pound ura
3)]| Erabedad Assign event ] rt
When the assignment
part of avithinetia’ expression WS siHaMeds ves an
al
1
embeded ssigament
me 2 23
Pp
p= Cz =10) ~ %%
Zz
4
= lo = 2* 3
= to -¢
pest
Zncrermen} / Decrement —Qpuator Cos --)
“These care th a
thot ancl
of o ven Yariable.
Tne vermeot Spats C44) wil
while deve
of qe vasiable by "
Scanned with CamScannerithe se
classmate
are Tutor -dwided inh tus.
re:
Pre_- increment / Pre -decvemeat C ++i) C
Tn_4his__Case, the copeator _preceeds the optiant and the
_yolue is _updaie fir __thich 1s utilised od 9 give.
eae
im
Post ~ incvereal [Post decrement Ci 4-4) Ci--)
In this Case she _apuctor —_‘sucecds the _apuanl ond
re ald: = volt is used during tte calculaticn cmd then
dhe value» updated a
a:+s bi cro
as}.
Cc = a-- + ++b Q+4 b= gi c213
2)
Scanned with CamScannerFey Ses
w= la>rb)? a:b % Carb)? Gea) !Gc=b)
anes:
= >b) ? Pare )i\ (bse)? be}
Carb) ? (Carved 202) :Ce ab) 7(LE>O 2=B:
Lh is the onl OY © jor thal Con tor!
re or ove ots. Tho sunke ‘rs
Rup 2) % (exp 3
00 is_ ew o_leff
psn ds 1s: vi firsh sf expt
exp 2% eval ad if @
east of duo variable
wing is dhe stakment
= (erbiaib
Scanned with CamScannerBitwise shidt KL 35 :
__% 220 Cooo1 6 100)
X2?3 I O6a00 1010
4) Oo0c0t01”
2) O00 goa 10
m 46h 00610100
) 0901010000
2/010 100000
a
a)100,0000
otooocaa => (ca),
Conved athe given decimal ae. nto binary and keep on
shitting He bib either fonords Me tell or vigint
Omiting th bib ad the one ond and replociog thorn [sith
Conseeutive J naymbee of zeros fore te other end
They ave _claisified os jot smitt ( $4) ad
rgb shift Coro),
Scope Resolution Opactor Crt
Toe \s_an _qpacdor which _is_used to excess she qlobal
Value of a variable which vis declared s outside al
the funcHons
Size of ©) opacdor
T+ veturns the size of the! mentioned variable io
bytes Ong stoves jbo into Qn in kgor vauiable
Faltoving ste table that lad doun the aid feunt
dota “hype ond 1h staan bi ond cpyle |
Char \_ by les 8 bib
int wv 2 bykes' 1¢ bb
float kk bude 3.2 bib
double ao bye ca bts j
Scanned with CamScanneroo.
Fun eon: call
| Aeray elemen!
Encrement
Aecreme ot
Complerned
Wess
Mu lh
divide
Modulous
Addition
Ss Hoo
eater than.
eader thon Ov cquicd to} Lido R
less thao
Ness thon ov equal 4p
Scanned with CamScannerScanned with CamScanner
| Conditional Lite R 1
| *s Psignal olor R_ tot ut
= Ope
| Comma _opecdor L R 12