0 ratings0% found this document useful (0 votes) 91 views16 pagesProgramming in C Upto Spring 2019
POkhara University Old is Gold
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
‘ POKHARA UNIVERSITY —
Level: Bachelor Semester Spring Year: 2019
Programme: BE Fall Mars: 100
(Couse: Progamming in Pass Masks 45
Time She,
Candidates are reqired to give thei neers thrown word fr
as provide.
‘The grein he margin indicat fll mars
Altempt all the questions.
5) What do you mean by insetons and sofware? Explain various ypes 7
software
1 Difetentae between algorithm and flowchart. Wate an algorithm and 8
‘owt ofind the number even by one divisible by 2,3 and 6 oF
1) Define operator and opera. List the types of operators and explain 7
say fre of hem.
1) Write recasve program to rise umber X to power nie X" 8
') Waite program to ganeate the following pater by lng the 7
sting ist
PROGRAMMING
PROORAMMIN
PROGRAMM!
PROGRAMM
PROGRAM.
PROGRA
PROGR
PROG
PRO
PR
P ‘
1) Enplsin the runtime and compile ne ination ofan aay wit
amples f
1) Write program to find the transpose dt 43 mats 7
15) What do you mean by recusion faction? What arth advantages and
Alsadvaninges of using recursive factions? Wrie 2 program to find
‘vere te amber prime or nol using wer defined fncion
5
1) Diferentaetetneen sae memory allocation and Dynami Memeary 8
Alloeson? Explain wih asutable example program.
Write program to pas aray elemento auction sing pointer,
1) Cena ests forthe folowing data.
Emp] Emp. Name | Adiess| Department
Dat of i
an] [9
‘Anil wits & progam To Tap 100 epee records ad ily
‘whose Departments "Sales
1) What is sigifieance of file poimer in Mle handing? Consider a 8
following srure
Roll No. | Name
‘dire | ty [Dae OF Bich
mm | aa | yy
ea program to ees nde” ile sre te above records
for 100 tasers
Wit short notes on: Any tv0) as
4) Pregrocesordestives
Union
©) Break and contin statements2) What eft cl by a ad al yee? Exp with
9 GaCOamtacO~ ™~
POKHARA UNIVERSITY
Love: Bachelor Semester: Spring "Year :2018
Programme: BE Full Mars 100
CCoae: Progamming nC Pass Mai: 45
Tine 3h.
Candidates are required to give tel answers intr own word for
‘os proctcabte.
‘The fees inthe margin indict fal marks
Abtempt ail the questions.
2) Draw block diagram ofa igtal computer. Explain ech component in
twist
1b) Dene he role ff chat in efient program maintenance with its
Cfaracte, Also develop a flow chit io rat the Armstong numbers
‘tween 1501050.
4) How can you declare following variables using suitable datatypes?
‘Mobile phone numbers, addres, body temperate, slay. Also expan
tach memory eccupaey siz and ange.
1) Why you use contin" and break” statement in your program? Explain
‘with sufable example program.
4 Difleretate re-set and poses Joop. Wile a progmam to generate
Fibonce numbers as per use’ choice. *
1b) Write progam to ead a one dimensional aray, srt the numbers in
tseending order and display sorted numbers
2) Write a program to ad wo 3x3 matic Display the sum stored in third
1) List the mor advantages of secursive funtion. Write a recive
Progr o generate the 10 terns Fibonacci sequence staring from 2.
2) What ace he advange of wing dyamie memory allocation over stag
‘memory allocation? Explain wih sutable example progam.
1) How ean fection rea lip values? Explain with example.
2) Wftea program o srt N numbers in nary daria
1). What ssgificance of ile poiter in le handling? Conse a olowin
srucure
Roll Ne, [Name [Adds [Focully | Dae OF Binh
‘wm | 48 | oy
Wie progam oct ude flee store the above ears for
Tod siden. Also ply these records of sidents who ae not rom
Kethman
‘Wit shot nots on Any Tw} 2s
«) Docunetation
wo polter
©) Generation of Computers.POKHARA UNIVERSITY
Level: Bachelor ‘Semester: Fl Year: 201
Programme: BE all Mars: 100
(Course: Programming in © Pass Mask 45
Tine 3h.
Candidates ae required to give thelr answers ther own words as far
os practicable
re figures inthe margin indict fl mars
Atept all the questions.
5) Whats computer software? Explain different types of software sed in
today’s ie
b) We algorithm ard draw flowchart generate Fbonacl sequence of
eight ers.
2) “What ae ifereat daa types avalabe in CP Explain ther type's
quae, conversion character, range of aloe and storage size In
‘pemory oecpied by each pe
by Difeeste between beak and comlnue sttemens witha suluble
example Progra,
8) What do you mean by faneson? Differentiate bemen fnction cl
ty vale adel by reference with sulabl rogran.
b) Write a meno diver progam to work folowing cases, take
propria input wherever equie
re Revere a mumber
AL Findsum of individual ig
fi Cheek fo prime
i Ext
What i dynamic memory alloation? Explain dire functions used
Indyeamie memory allocation
b) Deserve sting. Explin ary shee sing handing fection with
examples.
1) Whyary is impor in programing? How can you inline citerens
types of rays? Explain? cimensonal aay in
1b) What sa function petotyge? Find the sum of fist natural number
sing cuivefncion
What ae preprocessor directives? Differentiate between mse and
function wih deserting necessary example,
| 6
\ =
2) Diet ween al aoa able, Wie & pogrm 7
Ausra the we of state variable
1b) Writ program to crest ttre forthe folowing data fr cricket
ne (Country name, Player name plying tp Ce Btn, balling
‘rth , Number of matches played by player a Slr. Sve the
lnfomation ins file named "evckete” and displ the information
‘ofthore piers ho ha played more than 10 matches
Write shor nates on: (Any 0)
1) Program testing and deboeting
1) Opertr Preedence and Ascii
©) Sofware Developmen Life Cle
aesPOKHARA UNIVERSITY OS
Level: Babel
pa al
Bias
pata
mess
2) Why C is caled structured programming language? Compare und
ons ih elgg an Low evel nga
What ou ean yg sd ow cat? Wea ecm
sweet'
POKHARA UNIVERSITY
Level: Bachelor Semester: Fall Year: 2017
Programme: BE Full Mars 100
‘Course Programming a C ass Maks: 45
Tine Shes,
Candidates are required give thelr answers ther own words afar
as pratcabi
The ques th margin indicate full marks
Attempt all the questions.
8) What do you mean by propramming language? Disouss on machine
language, ascmbly language and high-level langue.
1b) Define algorithm and flowean. Draw a owehart to read 3 nambers
‘hom the we and find he seaest one
2) What isan opereor? Explain the conditional operator wit suitable
8) Waite pogra o pit he folowing poten
1
12
1b) How can you intlize an one dimensional aay? Write a program to
search an clement in one-dimensional aay conning five integer
When and how a function wl
osate wth uabl examples,
ig call by valve and call by
28) Explain the relationship between arays and pointers. How can ¢
pointer variable be used to access and modi single-dimensonal and
‘multidimensional rays?
“FRc ater rm Unio? Give expe codes
1b) What ar the diferent modes of. fle? Wate a program to 7
create 2 file “bllsnt, write dat info the fine and finaly read the
‘ita fom the file
Wit short notes on: (Any 0) »POKHARA UNIVERSITY
Level: Bachelor SemesterSpring Year: 2016
Progammene Fall Mars: 100
‘Couse:Prgzaning nC ass Maks 45
Time Shs.
Candidates are required tive thet answers intr own won for
‘aprotic
he flares in he mari ici fl marks
Attmpal he questions.
1. a) Whats programming langage’? Why is High Level Language(
refered to Low Level anguage(LLL)?
1) Whats the significance of algorithm and flows in programming?
‘Write an algorithm and éraw a neat Dowchart fing a number ad
heck itis palindrome urbe or nat{Not; Paindvome numer
‘remains same even atte revere suchas 99]
20) What is operator? Describe about the unary oper, binary operator
and tmary operate with examples,
1) Difzeate beeen while lop and do while lop. Write program
{0 prin the sum ofthe digits of number
3. a). Why are functions usee? Explain feton ell by valu and cll by
reference with xampes,
1) Define function, function defistion, fiction cling, function
evan wth code example
4.) Define oc variables and plobal variables. Explain differen storages
clases with examples,
1) How dynamic memocy allocation can be achieved? Explain wih a
suitable example. What are the advaniages of dynamic memory
alleaton?
5.8) What do you mean by ary’? How can you ialize one dimensional
ray t compile time and at ran tine? Explain with suitable example
1) Userecusive anc calls to evaluate
foyax-F+E Ee
6) What smenu driven suture explain with suitable programs
b
1) Why isle handing necessary in popramming? Write a program
input name, adress, ful, program and. GPACi maximum 0) of|
500 students and store them in "RESULT.DAT" dat fie and display
the records of those siden whose faculty i “Engineering” and
PADS,
Write sh notes on: (Any tv) as
8) The Pointer antici
1) Differences between scr and union
©) Testing and debusingPOKHARA UNIVERSITY
Level: Bscelor Semester: all Yeu :2016
Propamme: BEVArctecure Full Mais 100
‘Course: Programming in acs Matt 45
Time 3h
Candidates are reguired to give thei ners in hr on word for
erpracticable
The fires inthe margin indict fal mars
Atenpt all the questions.
2) What ae funcional diteretee beeen primary and secondary 31243
‘memory? Explain the function of conze unt wth the hep of Block
flagrsmof digit computer.
1) Define the role of ow chart in efcen program maintenance withits 344
character. Alo develop 2 flow chart 10 pit the even numbers
between 150100,
8) What isan operator? Explain the arithmetic, relaonal,logial and 245
asignnent operators in language.
1») Explain entry conlled snd exit contolled oops with examples, 44
‘Compare continu and break statements.
1) Why anay i called static dia type? Wie a programs w find sum of 246
agonal elements of mn mati
1) Define sting Explain he string landing funeton with suitable 245
example
42) List he major advantages of recusve function. Write a recursive 246
rogram to generate the 10 rms Fibonace! sequence starting rom 2.
») Whar do you mean by tomge css? Define is types with sutable 245
examples
1) Wee's program som he aray sing dynamic memory allcaton. 8
1) Dintererite pass by vale and puss by reference with suitable 7
example
1) Write a program fo crete structure for the following das for student §
(RN, Name, phone, adress and semester). Read the 10 stadente by
user and write only thse stienss whose semester is 1 in file
aden
~ ~
1) Dinereatate seucure and union. How the members of Nested 7
SSuctre are accessed? Show it with example,
‘Wit shot ots on: Amy two) aes
2) Void poiner
1b) Escape Sequence
©) Gorosiatement2
POKHARA UNIVERSITY
Level: Bacbelor Semester Spring = Year 2018
Progamme: BE Fall as: 100,
‘Cou: Progamming inc Pass Ma «S|
Time Shs.
Candas crerequred 0 give tar avers ine onward fr
ew prectcable
The figtres inthe margin indicate full mars
Atenpt ll the questions.
8) What & progamming guage? Difrentiate between high Bevel 7
language ad To evel aging,
1b) Wate te igideance of igritm and fowchnt in pogmmiing. §
Draw amet och to inp nimber ad checks pe numer
8) Desc the ouput genemted by each ofthe Hllowing pops. 7
‘inchede atdio>
tata =100,0=200;
int inet Gt
sain)
¢
Int count
for(count= 1; count = 10; Heoun)_(
Par, tne cop
)
fot et)
c
5-64 <309 @-2): B45
setume
1) Anclecticiy bound ches aconing fo the flowing mts. :
Rs. 40 perwnit
Forth next 200 unis — Rs. SO perunit
Beyond 200i Rs. 60 perunit
All wem am ao hamged ‘mow change, which equal 1 Rs. 50
‘Writes complete C program fed the humber of unis consuned
and pint out betta charges.
19) Wht do jou mean by anay? How ean you inalize one dimersonal
ray comple tine and at ra tie? Explain wit sue example.
1b) Why’ ave fictions used? Explain fnction call by value and call by
freace wih exams.
1) What do you mean by dynamic memory alain? Explain about
memory ek?
1) Wnt © nested stnctor? Welle © progam to input the Slowing
rmconts of ay 0 employees sing stneture and display them
repent.
=
ae [Far
5) What ar de diteeot fl opening modes 2 Wate a progam to
inp ras, ass, sgstmton no, Bully and academic year of
tdnksion in inbexiy’ of "x" number of suns of Pokta
Unive and append ther ine dat fle calle ‘STUDENT.DAT
‘Then dply th Reon of hare tens by wading he woes fom
‘STUDENTDDAT dat Sle who got admision in 2016
') How dynamic meiory allocation canbe achieved? Explain with
Suimble example. Wht aw the adianuges of dynamic meno
lca?
4) Use meusivefancton alt eval
‘Mest [Day [Yeu
Sy
1) Whatis 20 amy? Wale pogaim nC wad the clemens ofa 3*4
‘tec and Ste biggest al sales element ofthe mat.
‘Wate sho notes on (Any two)
2)" Paeutocoie
1) Seltmernialsinctue
2) Maem
aayPOKHARA UNIVERSITY
Love: Basher Semester: Fall Yer 2018
Progamne: BE Full Marks 100,
‘Cou! Programming in C Pass Mark 45
Time Shes
Candidates are required give ther answers in sir own words for
‘practable
he fires the margh taal marks.
Attempt al he questions.
©) What is flowchart? Write an sloth and daw a Nowehart to
Aislay whether x manber spine ono
1) Why header ils in is ince in program? Give reasons Also is
cout fret header ils you know, Tsteate the progam showing
the we of header le
2) Define operator in List ou diferent types of operators wed in
Explain thee of them with example
by Antec board charges acorn othe flowing rts
Tor the fist 100 nits =~ Rs 4 Pr Unit
Forth ext 200 nis Rs 50 Per Unit
Forth Beyond 300 urits-——Rs 60 Per Unit
ll users re lo chare meter charg, whichis equal Rs $0, Wit
‘program to rad muer of waits consumed and print ou the total
charges.
1) Wit program to ead a mal and find the sum ofl the digs in
maining
1b) Define funtion prototype? Wate a program to rea an integer munber
nd find he sum ote digs using recursive function.
on
\Whetis preprocessor dietive? Different between macro and
function with deseribingnecetary example.
') What pointer? Expsiameory allocation in programming, Why
mPIPID
sme + ou,
Sh smn ea
1 SHH 8
poe: A,
ALISWBAINA VYHDIOd| sound pea ©
| nary onsemHod @
wauan 0109
{ons Sy) 00 SoU HONS BHA
wa
uosss aaoqe 3
| te «| =|
| 110
1 sepsu0g, Buypumy og} wt svHOd Hy JO
“
Jo agun sy an sce Jo Suey NID oH
| {Pad pu sey 0s 2g oqe vou! PEs! Ow
Si pt stogs os un 3360‘ayn ¢x 0 sous Jonson wend WHE
Gendt Spunieifond ut eu asn a op Sq cA ue I HAL CQ
(979 VQVN “TRIN
“#204 yo] 01 NB pe WH OF yo] way} aus speed YIN PION
9 aunupuyea) 00 40 auospued Bun uoKs ap KNEW YSN
©
yun Spardas aos 586024 0956
‘uedion! wou 31
aqme afew ajo uns puro
mp 0 2909 19S JO OHI88N09
oe
wou Fupvono om Ady on westeud vasa (a
"0 soa vod
2 aM wena campos pur aquORTY 4 URDU NOK OP HEH (©
usseudat
ogy sone Jo 28ums aq puoxs no pnon mort sod wip 21509
smo} quod] aes pus snmousinyenb Jo asodind ost UA, CQ
“sa¥enfun|raestox 0 5461
uasip wpe (8Benfue Smsnuesto44 £4 ceour nos op UA Ce
-suonsonb 29 0 nucay
sara nono o yn soad
_gvoqoad 0
nfs spuon wn to sess ays G80 pumas aa QPP
same = omy,
sr swen seid we Bano 988009
oot semen "ye satue009
C102: 2K Sadly soo uDs sovoasee 7
ALIsuaninn vavHatodor ssiied
ssn a Sq ays us
ren
iy pougop sn gu. WMA © SI
yp poy SPY
Suywnumstost
1 oy sum sqguuen ain aap o7 sms astsou ay
Baduexs yun sussioo pu aygeves Suomedo Sus) MU)
00x py peso ap oH SguME
€ pres ov umpmoyy © ea “vatDNOLL pur UURLOTY aHUEG
ora coed, SUNN 2
suo ay oe
‘uous au ou sry
‘yeonanid so
ey—sosouas, aera 0
-ALgwaninn vawiDiod20