
























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
hkcmzmcmcmcmcxxcnmmcmnnnnnnnnn vnvcxxxvcxvcxxbvnbmmjnnmnbvvcbvcbvcxcxxczvx
Typology: Thesis
1 / 64
This page cannot be seen from the preview
Don't miss anything!
1 Draw th Computer
(Mouse
he block diag r is made up o Central proces nput section Output section Storage device
Central Proce Central pr It contains It also con It is also k CPU consis 1.1) Arithm 9 It 9 It 9 It 9 It m 1.2) Contro 9 It 9 It 9 It 1.3) Prima 9 It 9 Th
e, Keyboard, et
Computer
gram of com of mainly four ssing unit (CPU
n es
essing Unit ( ocessing unit s electronics c ntrols the flow known as brai sts of, metic Logic Un t performs all t can perform t calculates ve t takes data memory. ol Unit (CU) t controls all o t manages all t reads instruc ry Memory:- t is also known he processor o
tc...)
Programmi
A) Co
mputer arch r components, U)
is a main par circuitry that p w of data in the n of the comp
nit (ALU) arithmetic cal add, subtract ery fast. from memory
other units in t operations ction and data
n as main me or the CPU dir
(Hard
ing and Utili
omputer Fun
itecture and ,
rt of the comp processes the e system. puter.
lculations and t, multiply, co
y unit and re
the computer
a from memor
mory. rectly stores a
d disk, Pen driv
(RAM, ROM, et
ization (CPU
ndamentals
d explain ea
puter system. data based o
takes logical mpare, count,
eturns data t
system.
ry.
and retrieves i
ve, etc…)
tc…)
ach block.
n instructions
decision. , shift and oth
to memory u
information fr
Syllabus for 1
s.
her logical act
unit, generally
rom it.
(Monitor, Printe
ivities.
y primary
er, etc…)
am
2 Describe Advanta
9 Thi 9 Ge 9 Its 9 It i 9 RA 9 RO 9 PRO can 9 EPR Pro
Input Section The device It converts CPU accep Examples:
Output Sectio The device devices. It converts Examples:
Storage devic Secondary User can s It can be m It can stor Examples:
e advantage ges Speed: It can second units a solved within s Storage: It ca can be stored ormat we nee Accuracy: Co example, mult probabilities o high level of a be satisfied by Reliability: It
is memory is a nerally curren storage capa s very fast in M is Random OM is Read On OM is Program n store inform ROM is Erasa ogrammer can
n:- es used to ent s human unde pts information : Mouse, Keyb
on:- es used to se
s data stored : Monitor, Prin
ces (Second y memory is a store data per modified easil re large data c : Hard disk, F
es and limita
calculate mil are used to m specified time an store data in single sma ed. Now a day omputer perf tiplication of f mistakes. C accuracy is m y computer on t is very relia
accessed by C ntly executing city is very sm an operation Access Memo ly Memory an mmable Read mation only on able Program n delete and w
ter data in to erstandable in n from user th board, Touch s
nd the inform
in 1s and 0s i nter, Plotter, S
ary memory also called Aux rmanently. y. compared to p loppy disk, CD
ations of co
lions of expre measure the sp limit without in large quan all pen drive. M ys, Gigabytes a forms the co two very lar Computer doe ust in financia nly. able device. T
CPU, in random programs an mall compared compared to ory and it is vo nd it can hold Only Memory ce. Modificatio mmable Read write on it aga
computer sys nput to compu hrough input d screen, Joysti
mation to the
in computer t Speakers etc…
y):- xiliary memory
primary memo D, DVD, Pen d
omputer. Or
essions within peed of comp computer. ntity using var Moreover, it r and Terabytes mputations a rge number t s it in parts o al transaction
The informatio
m fashion d data are sto d to secondary secondary sto olatile in natur data permane y and it can h on is not allow Only Memor in and again.
stem are called uter controllab devices. ck etc…
outside world
o human unde …
y or External
ory. Now days drive, etc…
Explain cha
a fraction of uters. There a
rious storage reproduces da s are units of at very high akes more ti of the second , medical sur
on stored in c
ored in primar y storage. orage re. ently. hold data perm wed. ry. It can ho
d input device ble data.
from the com
erstandable in
memory.
s, it is availab
aracteristics
second. The m are some pro
devices. Millio ata whenever data storage speed witho me for huma d with accurac rgery, nuclear
computer is a
Syllabus for 1
ry memory
manently. Pro
old data perm
es.
mputer is call
nformation
ble in Terabyte
s of compute
micro second blems which c
ons of paper we need and devises. out any mista an and there cy level we w r plant, etc… w
available after
ogrammer
manently.
ed output
es.
er.
and nano cannot be
file’s data whatever
akes. For are high want. Very which can
r years in
am
4 Why C is C is called
5 Write a A set of i called sof System S System s for runnin "low-leve System s
s called mid d middle level Syntax and ke t gives advan t gives access Moreover it do We can devel assembly leve t is not hardw
short note o instruction in ftware. Software oftware is des ng application l" software. oftware can b Operating syst o user. It is a System suppo /O devices or System develo Ex: Editor, pre ion software on software is ecific task (ac raphics softwa on software is General purpo processing, we
lar to natural : C, C++, Jav AGES: er to learn. uires less time ides better do er to maintain portable. ANTAGES: quires compile rammers need bit slow comp
ddle level lan l language bec eywords of C a tages of highe s to the low le oes support th op applicatio l language to ware or system
on types of a logical orde
signed to oper n software. Si
be classified in tem: It contro bridge betwe ort software: I routine for so opment softw e-processor, c e designed to h ccounting, tick are and media classified into ose software: eb browser, ex
language and a, etc…
e to write. ocumentation. .
er or interpret d to learn stru pared to low le
nguage? cause are just like hi er level langu evel memory t he Low Level p n specific pro give more sp m dependent.
software. er to perform
rate the comp ince system s
nto three categ ols hardware een computer It makes wor ocket program ware: It provid ompiler, inter
help the user ket booking … a players. o two categor : It is used xcel, etc… It i
d mathematica
ter to convert ucture of high evel and medi
igher level lan age through f through Pointe programming ograms in C eed and effici Hence portab
m a meaningfu
puter hardwar software runs
gories as well as int hardware and rking of hardw mming, etc… des programm rpreter, loader
to perform ge …). Example:
ies. widely by m s designed on
al notation.
higher level l level languag um level lang
nguage (Englis function, mod ers. i.e., Assembly and at the s ency ble programs c
ul task is calle
re efficiently. I at the most
eracts with us d user. Ex: Wi ware more eff
ming developm r, etc…..
eneral tasks ( Enterprise so
many people f n vast concept
anguage to m ge. uage.
sh). ular programm
y Language. same time w
can be written
ed program a
It provides an basic level of
sers, and prov indows XP, Lin ficiently. For e
ment environm
word processi oftware, Accou
for some com t so many peo
Syllabus for 1
machine langu
ming and brea
e can use fe
n with C comp
nd a set of p
nd maintains a f computer, it
vides differen nux, UNIX, et example drive
ment to prog
ing, web brow unting softwa
mmon task, ople can use it
age.
akup.
eatures of
piler.
rogram is
a platform t is called
t services c… ers of the
rammers.
wser …) or are, Office
like word t.
am
t s
6 Define t
1. P A 2. S A p 3. H P 4. O O p 5. A A 6. C I t 7. I I
Special purpos ax calculation special require
the following Program A set of instruc Software A set of instr program is cal Hardware Physical parts Operating sy Operating syst provides intera Assembler Assembler is s Compiler t translates p ime. Interpreter t translates p
se software: I n software, tic ement.
g terms:
ction in a logi
ruction in a lo led software.
of computer i ystem tem is system active platform
system softwa
programs of h
rograms of hi
It is used by cket booking
cal order to p
ogical order t
is known as H
m software whi m to user.
re which conv
igher level la
gher level lan
limited people software, ban
erform a mea
to perform a
Hardware. Use
ich works as a
verts program
nguage to ma
guage to mac
e for some sp nking softwar
aningful task is
meaningful
er can see and
an interface be
ms of assembly
achine langua
chine languag
pecific task lik re etc… It is d
s called progr
task is called
d touch the ha
etween hardw
y language to
age. It conver
e. It converts
Syllabus for 1
ke accounting designed as p
ram.
d program, a
ardware compo
ware and user
machine lang
rts whole prog
program line
software, per user’s
nd set of
onents.
and
guage.
gram at a
by line.
am
Explain v
To find wh Algorithm Step 1 : Step 2 : Step 3 : Step 4 : Step 5 :
Flowchart
arious symb
hether given m:- Input no. If no mod Print given Print given Stop.
t:-
bol used in f
n number is e
2=0, goto 4. n no is odd, go n no is even.
Print no
flowchart.
even or odd.
oto 5.
is Even
Yes
Start /
Input / (Read /
Proces
Decisio
Subrou
Arrows
st
Is No
Stop
/ Output / Print)
s
on making
utine
s
top
start
Read No
o mod 2=0?
Syll
Pri
abus for 1st^ m
No
nt no is Odd
midsem exam
To enter n negative a Algorithm
Flowchart
Step 1 : Step 2 : Step 3 : Step 4 : Step 5 : Step 6 : Step 7 : Step 8 : Step 9 : Step 10 : Step 11 : Step 12:
number still and zero ent m:-
t:-
Initialize po Read no If no>0, go If no<0, go Increment Increment Increment Print “Do y Read ans If ans = “y Print pos, n Stop.
user wants a tered.
osÅ0,negÅ0,
oto 6 oto 7 zero by 1, ze pos by 1, pos neg by 1, neg you want to en
y”, goto 2 neg, zero.
Yes
Yes
posÅpos+
and at the en
,zeroÅ 0
ero=zero+1.go s=pos+1.go to g=neg+1. nter more num
s
s
Rea
Is n
posÅ0,neg
negÅ
nd it should
o to 8 o 8
mber?”
Yes
Do you wa enter mor
Print pos, ne
tart
d no
no>0?
gÅ0,zeroÅ 0
Åneg+
stop
display coun
No
No
ant to re no?
eg, zero
Is no<0?
Syll
nt of total nu
No
zeroÅz
abus for 1st^ m
umber of pos
zero+
midsem exam
sitive,
To find th Algorithm
Flowchart
Step 1 : Step 2 : Step 3 : Step 4 : Step 5 : Step 6 : Step 7 :
e factorial of m:-
t:-
Initialize c Read no Calculate f Increment If count<= Print fact. Stop.
f a given num
ountÅ1,factÅ
factÅfact * co t count by 1, c =no, goto 3.
Ye
mber.
ount. countÅcount+
es
co
fact
cou
No
stop
start
ountÅ1,factÅ
Read no
t Å fact * co
unt Å count +
Is count<=no?
Print fact
unt
Syllabus for 1st^ mmidsem exam
To solve s Algorithm
Flowchart
Step 1 : Step 2 : Step 3 : Step 4: Step 5: Step 6: Step 7: Step 8:
series 1!+2!+ m:
t:
Initialize c Read no Calculate f Calculate s Increment If count<= Print sum. Stop.
ount=1, fact=
fact=fact*cou sum=sum + f t count by 1, c =no, goto 3.
…….+n!
=1, sum=
nt fact. count=count+
cou
fa
s
c
Yes
start
untÅ1,factÅ 1
Print sum
actÅfact * co
sumÅsum +
countÅcount
Read no
Is count<=n
1,sumÅ 0
m
ount
fact
o
no?
No
Syllabus for 1st^ mmidsem exam
3 Explain A data t types to
1) Pri Prim as f
The string fo format comm printf() retur
n different da type is a class o allow progra
mary data ty mary data typ fundamental d a. int int is in values. types ha
short int long in
b. char char dat assigned
char
c. float float dat point an
Pri (
ormat consists mands that de rns the numbe
ata types av sification of va ammer to sele
ypes pes are built in data types.
nteger which C has 3 class ave signed and
Size (bits) int 8 16 nt 32
ta type can sto d some intege
S r 8
ta type can s d fractional p
imary data ty (int, float, char
s of two types efine how the er of characte
vailable in C. arious types o ect appropriate
n data types. T
is whole num ses of integer d unsigned fo sig Range
-128 to 127 -32768 to 32 -2,14,74,83,
ore single cha er value which si Size (bits) 8
store floating part. When the
Data T
ype r)
s of items - c other argume ers printed.
of data, as flo e type of data
They are direc
mber without r storage nam rms. gned
,648 to 2,14,
aracter of alph is known as A igned Range -128 to 127
point numbe e accuracy of
Type in C
Derived data (array, point
characters tha ents to printf()
ating-point, in a type.
ctly supported
fraction part mely short int
habet or digit ASCII values.
Size (b 8
er which repr f the floating
Secondary
type ter)
at will be print ) are displaye
nteger, or stri
d by machine.
t. Its range , int and long
u Size (bits) 8 16 32
or special sym
Uns bits)
esents a real point number
data type
User d (structu
Syllabus for 1
ted on the sc d.
ing. C is rich i
They are also
is machine d g int. All of th
unsigned Range
0 to 255 0 to 65535 0 to 4,29,
mbol. Each ch
signed Range 0 to 255
l number with r is insufficien
defined data t ure, union, enu
reen, and
in its data
o known
dependent hese data
haracter is
h decimal nt, we can
type um)
am
2) Sec Sec to h
4 Explain Constan
use the extend t
float double long flo
d. void The void float or c
condary data condary data t handle real life a. Derived Derived be chang i. ii. b. User de User def and/or d i.
ii. iii.
n types of co nt is somethin
Nu
nteger consta
double to def the precision f Siz 32 64 at 80
d type has no char. The void
a types types are not e data in more d data type data type is e ged. Example Array: An arr Pointer: Point efined data ty fined data typ derived data ty structure: Str grouped toge union: Union enum: Enum enumerators. the language Example: enum day enum day week1std onstant in de ng whose valu
umeric consta
ant R
fine the numb further we can e (bits)
value therefo d data type is
directly suppo e convenient
extension of p s: Array, Poin ray is a fixed-s ter is a specia ypes e can be crea ype. Use can ructure is a co ether and know is like a struc is a user-defi
. The enumera .
y {Mon, Tue, y week1stday day = Mon; etail. e does not ch
nt
eal constant
ber. The doub n use long dou Precision D 6 14
ore we cannot used to indica
orted by the m way. It can be
primary data ty nter, etc… size sequence al variable whi
ted by progra design it as p ollection of log wn by a single cture, except t ined type cons ator names ar
Wed, Thu, Fr y ;
hange through
Consta
Singl
ble is same as uble which co Digits Rang 3.4E 1.7E 3.4E
t declare it as ate that funct
machine. It is e further divid
ype. It is built
ed collection o ich contains m
ammer using c er special req gically related e name. that each elem sisting of a se re usually iden
i, Sat, Sun};
hout the progr
ants
Non
e character co
s float but wi nsumes 80 bit ge E-38 to 3.4E+ E-308 to 1.7E+ E-4932 to 1.1E
s variable as w ion is not retu
combination ded in two cat
t-in system an
f elements of memory addre
combination o uirements data items of
ment shares t et of named co ntifiers that be
ram.
n numeric con
onstant
Syllabus for 1
th longer pre ts of memory
38
E+
we did in case urning anythin
of primary da tegories,
nd its structur
the same dat ess of another
of primary dat
f different dat
he comman m onstants calle ehave as cons
stant
String co
cision. To space.
e of int or ng.
ta types
re cannot
ta type. variable
ta type
ta types
memory. d stants in
onstant
am
Identif
7 Explain An oper rich set
1. Ari Arit + - * / % 2. Rel Rela Rela < <= > >= == != 3. Log Log && || ! 4. Ass Ass sho
The tokens a There are six other separa fier : An identifier The words w Identifier ref rd : Keywords ar the compiler They cannot data type : void is a prim It is generall
n operators a rator is a sym of operators thmetic Ope thmetic opera Addition Subtract Multiplic Division Modulo d
lational Oper ational operat ational expres less th = less th greate = greate = is equa = is not gical Operato gical operators & logical logical logical signment Op signment oper orthand assign
are the basic b x classes of to ators
is a sequence which are defin fers to the nam
re reserved wo r. be used by p
mary data typ ly used to sho
available in C bol that tells t as below, erators tors are used or unary plus tion or unary cation
division
rators tors are used ssions are use han han or equal to er than er than or equ al to equal to ors s are used to t AND (Both no OR (Both zer NOT (non ze perators rators are use nment operato
building block okens in C: ide
e of letters an ned by progra me of variable
ords whose m
programmer fo
e. void means ow that functio
C the compiler t
for mathema s minus
to compare tw ed in decision
o
al to
test more tha on zero then t ro then false, ro then false,
d to assign th ors which simp
s which can b entifier, keyw
d digits. mmer in a pro es, functions a
meaning is fixe
or other purpo
s nothing, no on is not retur
to perform ce
tical calculatio a+ b (additi a – b (subtr a * b a / b a % b (this data type)
wo numbers a statements su
n one conditio true, either is either is non z zero then tru
he result of an plify operation
be put togethe ords, constan
ogram are kno and arrays.
d and they ar
ose.
value. rning anything
rtain mathem
on. C support ion), +7 (una raction), -8 (u
s operator can
and taking dec uch as if, for,
on and make zero then fal zero then true e)
n expression to n with assignm
er to construct ts, string liter
own as identif
re used for som
g.
atical or logic
s following ar ry plus) unary minus)
n be used with
cisions based while, etc…
decisions se) e)
o a variable. C ment
Syllabus for 1
t programs. rals, operators
fier.
me special pu
al operation.
ithmetic opera
h only integer
on their relati
C also support
s and
urpose by
C has
ators
ion.
ts
am
5. Inc The +
6. Con A te exp Ex: if(a
else
7. Bitw Bitw or d & | ^ << >> 8. Spe & * , si . -> 8 Explain
Assign = a += = a -= 1 = a *= = a /= 1 %= a %= crement and ese are specia
b) x=a; e
x=b; wise Operat wise operators double. bitwise bitwise bitwise < shift le
shift ri ecial Operato Addre Pointe Comm zeof It retu memb memb n conditional provides specia
ns value of rig 1 is same as 1 is same as 1 is same as 1 is same as 1 is same as Decrement l operators in ments value b s postfix, the =10; b=a++; s prefix, the v =10; b=++a; ments value b postfix, the ex =10; b=a--; a prefix, the va =10; b=--a; a erator or is known a if exp1 is tru :b; which is s
ors s are used to
e AND e OR e exclusive OR eft ( shift left m ght ( shift righ ors ess operator, i er operator, it ma operator. I urns the numb ber selection o ber selection o l operator (t al conditional
ght side to left a = a + 1 a = a - 1 a = a * 1 a = a / 1 s a = a % 1 Operators C which are g y 1. expression is after this stat value is increm after this stat by 1. xpression is e after this state lue is decrem after this state
s Conditional e then execut ame as
perform opera
means multip ht means divi
t is used to de is used to de t is used to lin ber of bytes th operator, used operator, used ternary opera operator (? :
t side
generally not
evaluated firs tement, a= 1 mented first an tement, a= 1
evaluated first ement, a= 9, b ented first an ement, a= 9, b
Operator. te exp2 otherw
ation bit by bi
ly by 2) de by 2)
etermine addr clare pointer v nk the related he operand oc d in structure. d in pointer to ator) with ex : ) to evaluate
found in othe
st and then th 1, b = 10. nd then the ex 1, b = 11.
and then the b = 10. d then the ex b = 9.
wise exp
it. Bitwise ope
ress of the va variable and t d expressions ccupies. . o structure. xample. e conditional e
er languages.
he value is inc
xpression is e
e value is decr
xpression is ev
erators may n
riable. to get value fr together.
expression in
Syllabus for 1
cremented.
evaluated.
remented.
valuated.
ot be applied
rom it.
single line.
to float
am
10 Explain
void main() { int s float avg= print avg= print } n operator pr cedence of an erator precede
Rig
Lef
Lef
Lef
Lef
sum=47, n= t avg; =sum / n; tf(“Result of I =(float)sum / tf(“Result of E
recedence a n operator is it ence is why th ng 16. multiplication the multiplica he left-to-righ e. ativity is why t g 7. subtraction op an't decide by ativity. provides a com highest prece ssociativity ft to Right
ght to Left
ft to Right
ft to Right
ft to Right
ft to Right
Implicit Type C (float)n; Explicit Type C
nd associativ ts priority in a he expression
operator (*) ation must be ht or right-to-l
the expression
perator (-) is y operator pre
mplete list of o edance level a Operat () [] +, - ++, -- ! ~
& sizeof (type)
/ %
<<
<
Casting: %f”,
Casting: %f”,
vity. an expression 5 + 3 * 2 is c
has higher "p performed fir eft order for g
n 8 - 3 - 2 is c
"left associati ecedence alone
operator, their and 15 is the l tor Des Func Arra Una Incr Logi One Poin Add Size Type Mult Divis Mod Add Subt Left Righ Less
avg);
avg);
for evaluation calculated as
precedence" o rst. grouping oper
calculated as (
ve", so the le e in which ord
r precedence lowest. scription ction Call ay Element Re ry Plus, Unary ement, Decre cal Negation s Complemen nter Reference ress e of an object e Cast (Conve tiplication sion ulus ition traction Shift ht Shift s than
// implicit ty // This will p // explicit ty // This will p
n. 5 + (3 * 2), g
r "priority" tha
rands to opera
(8 - 3) - 2, giv
ft subtraction der to calculat
level, and the
eference y Minus ement
nt e (Indirection)
ersion)
Syllabus for 1
ype casting print 4 ype casting print 4.
giving 11, and
an the additio
ators that hav
ving 3, and an
must be perf te an expressi
eir rule of asso
d not as
on
ve the
nd not as
formed on, we
ociation.
am
11 Explain Backsla Back sla known a E
Trigrap C introd availabl T
Lef
Lef Lef Lef Lef Lef Rig Rig
Lef n backslash a ash characte ash constants as escape seq scape sequen ‘\0’ ‘\n’ ‘\r’ ‘\f’ ‘\t’ ‘\b’ ‘\’ ‘\a’ ph character duces concept le in some key Trigraph seque ??= ??( ??) ??< ??< ??! ??/
ft to Right
ft to Right ft to Right ft to Right ft to Right ft to Right ght to Left ght to Left
ft to Right and trigraph er: are a special quence. Escap ce End End Carr Form Hor Bac Prin Aler r:- t of “trigraph” yboard of non ence
h characters.
type of chara pe sequence st
of string – N of line – take riage return – m feed- takes izontal tab k space nts backslash c rt – provide ed
sequence to n English langu
Less Grea Grea Equa Ineq Bitw Bitw Bitw Logi Logi Cond , /=, =, -=, =, |=,
=
Assi
Com
acter constant tarts with bac M ULL. es the control
character
dible alert.
provide a way uage. Each tri Tr
[ le ] ri { l } ri | v \
s than or equa ater than ater than or e ality quality wise AND wise XOR wise OR cal AND cal OR ditional Expre gnment Opera
mma Operator
t which are co ckslash ‘\’ char Meaning
to next line. ntrol to the ne e next page.
y to enter cert graph charact ranslation number sign eft bracket ght bracket eft bracket ght bracket vertical bar backslash
al to
qual to
ession ators
onsists of two racter.
ext paragraph
tain character ter consists of
Syllabus for 1
characters. Th
h.
rs which are n f a three char
his is
ot acters.
am