Computer Programming
Computer Programming
Computer Programming
\\ I
3- a) Compare if-else-if ladder and switch construct with example and flowchart.
I5l
b) lvrite a program in C to gen€rate following pattern using unformatted input/ouput
functions only.
l5l
N
'vv e
PPP PF
aaaa aa t
X,LLLL LL LL
4' Write.a program in C to find out whether the nrh term of the Fibonacci series is a prime
nu'mber or not. Read the value of n frorn the user and display the result
in the main
function. use separate user-defined f,nctions ro generate
check whether a number is prime or nor.
r#';il,il";;;;; i"#La
,o
tg]
,</ \
t)-J-r'
5- a) How two dimensional arrays are created in C programming? Write a program to read
NxN and find sum of bo& diagonals.
square matrix of size [2+41
6f Write a program in C to check whether a given string is palindrome or not using user
defined function,,,
r'a
I
. ,"., L41
'6. what are the advantages of using pointer in C programming? write a program in C to
find,. second largest elements from an array containing N elements using concept of
pointer. l2+4j
7. Explain structures and nested structures? Create a structure to hold any complex ntrmber
x+iy. Write a program that uses the structure to read two complex numbers and display a
third complex number which is the multiplication ofthe entered complex numbers. [3+5]
8. a) What are different inpuVoutput functions used with data files in C? Explain with
syntax and examples t4l
b) Write a program in C to read integers from usbr until user says "no". After reading the
data write all the odd numbers to a file name odd.brt and all the even number to file
named even.txt.
;i':
t4]
9. When can we use recursive functions? Why do u,e need control statements in computer
programs? Differentiate between do...while and for statements. 12+2+21
characteristics of FORTRAN Programming? Write aprogrcm in FORTRAN
do.Whatut'th"
to calculate the value of n by evaluating &e following formula for the first 25 terms. t8]
n=4(r-i.1-+.;-...)
:t ,F rk
01 TII.IBI.i L]\IAN I] NI V I]R S IT\T Exam.
ii----------,,,-
NSTI'II]I'E O]T ]]NGINEERING Level BE ; Full Marks :80 i
i. a) What is a programming language? What is the difference betv"een source code and
object code. 12+21
b) Wirat is debugging and testing? What are the step that need to be follou,ed for
der.,eloping the application software. l2+Zl
2. a) What is the difference betu,een variable declaration and variable definition? Explain
with example. 14)
b) What do you mean by macro expansion and file inclusion in C? Explain with
example. L4l
3. \\/hat are functions used for forrnatted and unformatted output? Write down its syntax.
Write dou,ll the output of printfl function lor the following sections of statements. l4+41
float a : 5.7891;
int b: 6789;
printf("a:%4f andb:o/o-ld from first line", a,b);
printf("a:oZ-7 .2t andb:%07d fi'om second line", a,b);
print("a=9/0.2f andb:oh2d from thirci line", a,b);
a) Explain about while ioop vr,ith its syntax and flowchat. l4.l
b) Write a program to convefi a decimal number into binary number. 16]
5. a) Can a finction return an alray to the calling function? Explain u,ith example. t1l
b) Write a program to read a mxn matrix of integers and to find the largest eiements of
eacir row. Store the largest elements of the ror,r, in a one-dimensionai aray of rt
integers before displaying them. t6l
6. a) How does a structure differ from an array? What are the different ways to access
structure member? 14]
b) Create a structure named student that has name, r:oii and marks as members. Assume
appropriate types and size of members. Use tiris structure to read and display records
of I0 students. Crete two functions: One is to read information of students and other
to display the information. l6l
l. a) lJefine following tenn: t<t
t.'t
j) int'rp;
ii) int p(char*a)
iii) int(*p(char*a))
iv) int *p(void)
r,) intt(*p[1 0])char a)
b) Write the advantages of using pointer in C- prograrnrning. 13I
1. Explain the generations of programming language. Distinguish between High levei and
Low level programming language. [3+3]
2. is an algorithm and how it dift'ers from pseudo-cc,de? Develop algorithm and draw
trItrhat
flowchart to find the largest of N numbers. [2+3+3]
3. a) \\4rat are identifiers? List the rules to define valid C identifiers. [2+3j
b) \\rhat is operator? lJescribe the conditional operator in C with syntax and exarnpie" [2+3]
4. What are the differences betrveen global and local function, variables and data types, &
(Ampersand) operator and * operators used in c-programming language? Explain rn'ith
example. [4+4]
5. a) Differentiate befween pass by value and pass by ref"erence. t3l
b) Explain the significance of user defined firnctions with exarnple. tsl
6. a) Write a program to read a string and check whether it corrsists of Alphabet *r not. Use
user defined function to acconiplish the task. tsI
b) Explain how 2D array is passed to a function. Write a C prograrn to display largest
and srnatrlest elements of a, 2D array. l_si
7. What is nested structure? Write a prograrll in C to read name, age and salery of 10
difibrent ernployees as the three members of a structure named as "employee". Sort this
data in salary basis using user detlned function anC display sorted data from main
function. [2+8]
8. Write a prograrn in C-programming language to colnpute the cosine seies. (hints:
cos(x) : l-x2/2!+xol4r.-*616t.*".............up to n terms) t6-I
9. Write a program to open file named INVENTORY and store in it for maximurn 10000
data of ITEM-NAME, NUMBER, PRICE, QLIANTITY. Extend the program to read this
data from the above given filename and display the inventory table with the value of each
item. t6I
10. a) Cornpare unconditional goto and computed goto in FORTRAN with s,vntax. t3I
b) Write a program in FORTRAN to read an arr&y containing N elements, sort this data
in ascending order and display the result. tsI
rF**
].
TRIBHUVAN T]NIVEF.SITY
INSTITUTE OF ENGINEERING
Bxaminutiot, Control Division
2072 Kartik
as practicable'
Candidates are required to give their answers in their own words as far
Attempt All questions.
The figures in the margin indicate Full Marks
Assume suitable data i"f necessary.
b) What are the differences betrveen formatted and unformatted Input / Output. Give
o l}i,o/o3c,o/o'10.3f and %x' [1.ha]
suitable example with sample output for the foilowing:
What are the purpose of the continue statement? Within which control statements
can
,J. a)
statement'
continue statemelt be included? Compare with the break 11+7+2)
4. What is the meaning of function prototyping? Write a program to calculate the sum of the
series 1+11+1 t l+..I...+,rp to N tirrns uri.rg .""ursive function. If N is read as 5, the
series il
is:1+11+111+1111+11111. [2+6] i.
i
5. a) Explain with an example for compile time initialization of 2D array- Describe how
given
compilier manages according to the number of initializers and size of an alray ',
b) Write a program to read a word from a main fiurction, pass it into a function that rvill
convert ail of its characters into upper case if the first character is in iower case and
into lower case if the first charactei is in upper case. Display the converted string from
main function. lsl
6. a) Explain need of structures. How can we create and use a structure within another. [2+3] :
b) Explain clot and affow operators for accessing the rnembers of a structure. l
13l
7. a) If Ptr is a pointer to user defined type or basic type, by how many bytes is Ptr
incremented when the stater-nent Ptr++ is executed? [2]
b) Write a C program that calis re\rerse array () to reverse the array ancl return the array
and display the etement of reversed array using pointer' l6l
8. t,ist'different types of standarcl llo used in 9: Yli,,._ufiog:"". to write name, roll'no a:rd
age of f,tve students into a disk file name "STUDENT'DAT"' [2+6]
9. 'a)
' Explain diffgren! types:of goro statements in FOR.I'R-{N programming with suitable
i Write a program to read n from usei and display the sum of iollorving series
'
"*u*ple.
til1;'iteims: 1*i1+Zy(1*2'j1+(1 +2-3+4)+...........n L4+4]
b) Explaln rvith suitable exampie i6 s[or.v how an hnpiled Do loop rvorks in FiORTRAN' t4l
* {:ir
i I..-.---r
l-Ri BHir V u\rr l-ll\ lVii il.:i i'i
I,ereI fluil }5;rilis , 8ii
iNl; t l'flj1-ii Llir E1!alil'lE,rrlj'-iN'lr
il xilminati* ra C o :etr'$ I B i *,'cse*:e
I irne i lli:i.
?072 Chaitra
,/ Cariclidates are requirerl io glv'e their ansu'ers in tilelr c'wn wurds as far as ;;;;';;;;';
'/ Att cntpi 1!1! cttte";tici''t
'/ The Jigures in the ntargln inciicctte {4!-Mgrks-
'/ Asstnne suitub/e dttta iJ'nece siurll
What is a flovr chzirt? IJse the valions cornmonly use'i flovi chalt symbcls. !{or,v
ctoes
1
a)
a florv chait trelp compul.i:r prograrnming? l:+l-l]
b4 l,Vhat is a progran-r? Briellrv soiivrare-
<iesclibe iypes of coritpllier {2.2)
a) Wirat is an operatol, d.atat-YPe, constant and ','ariabie? ileline. [6t
3. a) F{arv;s ttre sv,,itctr siatentent usecl iri tlecisit,n nlak-ing? Eili:la"irr wirli a" st-iiiablt:
r;i8iTI0ie .
i41
l'I
(.iny nrtnber is a i.i icngulrtr number if the sttru o{ ntLttrro.l nt.rnber V'ofit I lc env vttt:viber i
is exitc:tl;,equal tct that;r-un.ber. For e.g 1,3,5,!C,15 erc ore ffiangular nurt'"bzr es'
t+2-J, l+2+3:6, i+2 r3+4--i0, I +2+3+4 '5:l5)
A< a') Briefly explain the passing by value anrl passing h',' r*fe,ence in filncticn "xilh
eKaintrle '
i5i
b) Write a prograrn to calculate sum of digits cf a giv'en 5-ciigits numbcr entererl b1' tile
i.iser lrsing recursive tunction' it,j
5. What is a string? write a prograiri to read a -l*-l solrare rnatrir. tind iDrriircLrrli,itlegei
. value of a rnairix, replace the diagorral elements by the mirrirnrmr eLetnent aird ili:icia-,' ii' i 1- i)iol
i4
using pointer.
i71
;f $ What is the prii-rcipal <liff'erence Lretween a strltcture and arr affzy?
'
fl lvrite ptcgrant ..0 y;,.d sil:ucture "coiiege'' ha'ring name, es-tDale anil i0c;r.tiol, 'r;h,:;i
a
estDate is rr', ,nrrt.ter slnjcilrie !iat':ng'J11 . nrontll and )'cu.i ,J mcri'"bir'3. i;i;,41 ": i'.'
tcr:ot'ds ol i'J colteges ['3'i
7{ a1 Wirat is a aata.frle in C? Wliar are tire rnocie s iii fiie han,'llii,g'i Ei-ola.irr }x'le il'';. Ii _i-r '-li1
b) Write a'pfogranl io rtaii rnitiinialion ,-,f a f,tle riSltr':i "crit:r ixt" and ,','ii;e ' iir-r
t1-ie-'
lKi
conilnts to a.n':riher file "recciil'r:il ' iL't '' :
i,:
in r.t.;.lrix folry1. t-'_:
ENGINEERING L!ag| - --,-]
INSTITUTE oF - --f
ExarninatiOn
iOn COntrOl DiviSiOn Ii Programme
Program_me -----
ntl(ExceptB.Arch)
II All(Excepr passMarks
B.Arch) j| pass Marks i ]2
shawan [I*1g.1iL--iIL1-----*------Ti,""-_- --ii *-_
!
L4l;,
05 , TRIBHUVAN MVTVENSITV
INSTITUTE OF ENGINEERING
Exarnimation Contro[ Division
2071 Chaitra
4. a) Write a program to display Armstrong numbers between the range entered by a user
and also.disptay their counts. You must use a futrction to check for Armshong
ruunbers and display them lrom main' t4l
b) What do you mean by nested function and recursive function? Give an example of
t)+)1
recursive function. L" -)
5. a) Write a C prograni to read a string and display its reverse. Use user defined function
to count number of characters in it and to reverse it' t4l
b) Write an algorithm to insert a value in afl array at a position gir,en by user. [4]
6, What is a tag? Must a tag be included in a structure type definition? Must a tag be
"l included in a structure variable declaration? Explain' .
tl+t+2)
b) Write a C program that reads several different names and address using structure
r-i11
cornputer, ,"ur.ing" the names into alphabetical order atl,i write out alphabetical list. L.tI
.7.. Illustrate r,vith-exan-rple that "Aray is indirectly a pointer". Write prcgram'to calculate
sum and average of integer nunrbers between M ancl N (where value of M and N are
read
14 )-4j.
from keyboard) using Pointer.
8. Write a piograrn to continuously reacl name, age and salary'ola rvorl<eruand write it into a
f,rle untii uslr confirms to end. Then read n from user and display iile n"' record
in the file .
"Ifetails of worker must be represented by a structure' U)
g,a)Compatearithmeticand1ogicaiifstatementSirrFoRTR^'I{-' L7l
3- a) Write a program to read the number until - 1 is encountered. Also count the number
of
even number and odd numbers entered by the user.
b) Distinguish between break and continue statement with t6l
example
[4]
4- a) Explain how function is defined in C'1 Dii'ferentiate call by value and call by
a, " h)
reference.
rV:;ic a progratlrr using a Q.r:c i,r,i that refum:
.he iargest nu:rb.;r lrom an irra1, of'
ll f2l
numbers that is passed to the function.
tsl
5' a) How are one dimensional and rwo dimensional arrays created in C? Explain with
exarnples.
b) Write a C program to read two matr.ices from user, add them and display the result in 12+21
matrix form.
t6l
6' What do you mean by nested structures? Cive suitable example. write a prograrn
to read
the heights of two students and display the difference betvu,een the ir heights.
Use feel zurd
inches as membe rs of a structure to defirre heishL.
[2+61
1 . a) Compa:e array and pointer vr ith exampic.
b) Write a program to read a string from user and use a user defined fi-rnctron to copl,rhe l3l
content of the read string Into another ch:rracter array ehangrng lower case 1ener to
Lrppef if.a.'n1, Use poir-iter to proce ss the stnnq
ir l
8- \\/rite a Drograrn to read the details of book ar,ri)ois and wrire it to a irle, until the user
conf-rrrns to en'l , rhrn rta.,,i a.d rlisplay lhe atl're..:din rhe fil:.. vr.lcri
n i,. rcad L,or:r tl..c
user- Tlic dita for ar-rthors musr be represellied b,,, :tlrctrrres ti,ai
corrtai tr namil, nationally
and number oi'books publisheo.
tri l
12+ 2l
,-:h0t
n{ h --
I. a) What 'do you mean by software and explain about generation of prograkroing
languages.
:
inta=2,b=3,c;
a: (b++) + (+$) + a;
c:a>b?a:b;
b: (a#) + (b__) .ra;
c = c+++b--;
b) Whatare rhe difference between formatted and unformatted VO statcments? Describe
witJr proper example.
a) Explain importance o
'i i
-
PULCHO
-
,- ]
prilcHoW 1
PULCTI()WK
4. a) Define i'filnction definition" and writc the program to fino thc sum of two numbers
usin g user{cfi ned :fiurct.i ons.
b) plat do yoir mean by "call by value and Uy rcfcrcnce,' alon& witlr suitable
cxample? "uJl
t4l t
!
5. Can we pass.wholc array element from fuucrion? Wrire a Drogrux to displav only lhose I
r
sludents information which are passed. Use separatc luncrion ro chccK the result. of-
'l'he inibfiation
of student( Iike Name; itoll,No, Addrcss and Marks are passi:rl
from main functions *d pors to functions uslng arra)'type arguments. : ' ' -- I
ltud"al- .
I
' 12+gl
.:l'
I
:
1. Differentiate between high level un6 1614' level' Explain the steps of solving a proble'rn
using cornputer. t4+41(
2. Consider a statement
scanf ("%s", sLr) ;
5. Explain how array can be passed to functions. Write a progmm that passes an array to a
fi.rnction and print the largest and smallest element. [2+6]
6. How are structures different from arrays? Create a structurc in C to store the name of
a
batsman, runs scored and no of times the batsman in dismissed. ln the prQgram, read the
data of five players and display ihe batting average of the player whose name is entered
by the.rr"r. i"tting ur"rug" it totalruns/totaldismissals.
given by [2+6]
9. Rewrite the following source code correcting any error present in it. Also indicate the
error corrected in comment. Then write the output of the program. [4+4]
I
I
(
t)5 TRIBI,lUVAN IJNIVLRSI I \' l-x a nr.
[\STITU fE OF ENGIr _.-EERINC l.evcl BE Iiull Marks B0
Ilxa nr i n ation Control I)ivision A ll L.rcepr
l'rogrlrnme l)rss r-ks I 2
B Arch N4 a
2069 Chairra Yt;rr i Parl t/t 1im9 i hrs.
r
E,xprain the rore of
b) Explain the importance oitlowchart. [2+2\
Also draw a flowchartto find reverseof
integer r;umber- For example, 12345 is an
an integer number and its reverse
is 54321.
lt+31
2) a) why do we incrude.<stdio.h> in our program?
can we write a C prtigram without
using any header file?
b) C ive the outpur ol the lollo*,ing [2+ i]
program and.1 ustr$,youi- answ.er with reason.
. #includecsrdio h> t3l
int maino
int a,b;
a=\ + 2+\,15 Z* J- ,
b:++x *(y-3)/2-z++*y,
printf("a:o%d ''.r);
prin tf("b:%d",b);
retum 0.
|,
[21
c)Writcaproqralnthatprintsttrei)oaringpointr,alue.,vithfollorvirre.specification.
' i) Correct \]p 10 t\\'o decinrai piaces
ii) Cor-rcct up to forrr rlccinral places
])a)Writeaprogranltoreadthenumbcr-t.ll.rtil.liserrcorintcrcdAlsoCollntthenurrlberof t6l
b;' tlle user
numbers erltered
prirne number and conrposite
b)ExpiainwhygotoStatementshouldbeavoided?Distinguishbetrveerrbreakand Il+3]
source code'
continue statemellt with erample '-r ^...
exp(x'y) usirrg luncrion rvithout using
to calculate the l:1":i)'"
4) a) Writ'e a program [41
powO tr.,n"'ion' 1i*pt"' exp(2'3)=2^l i e' 2r2r2:8')
with example' t4l
reierence and call by value
b) Diflerentiate between call by
a 3+3
(\ E-^t-:- h^\r,2ff2w"an be oassed to a function.
write a program totranspose
)) Li.Pi;iii iit'- *"-J
matrix.Twomatrixareinputfromthemain()functionandpasstoauserd^efined lz+6)
functionwithargurnentasafiay-Theresultisdisplayedfromthemainfunctton. 6r
6)Whatisadvantageofusingstructure?CreateallarTayofstrucrurenameEmployeelvith
nameandsalaryasstructure*",u*undthearrayofstructureispassedtoafunction
display the sorted srraY from12+61
in ascending order on the basis of salary and
which sorts
main0. t3l
example
1) a) Compar e array and pointer wrth n to copy the
i
i
l"
I
i
I
I
I
I
l
I
.- t;i"
06 TRI:]HI.JYAN T\IVERSITY
iE*;. ,- , ii;.r. iill'oo siiir, .q il,i"ii
. lE
I
i Define aigorithm. Wrire an algorithm for finding largest and smallest vailres ficn a list. 2+61
2. Drarv a flc"vchart and algcrithm to find roots of a quadratic equation (ax2 + bx + c:0).
Inciude ai1 iluee conditions of tiie detennini.*rt.
Ii c]
:i. \ir'te a piogram to i-ead values fiom user and fi,d sum ur:tii osoi tlpes 0, al:'t dispiay'
s'rrn and average. trl
iui
\1i11'1ll"c'5;ralnmers preier using rrser defined iirncticns? WhrLr is rnrrits and iJerneriis oi
'1.
using iunctiori:r in prcgran? Differentiate actr,iai and fonnal paranrerel's useC in 1i;ncirons.i3-2-l I
5. \i./rite a program to take a list of valr-res I}cn-i iiser into an arra.y. Pass tfie list r,t-r a tr,inctl.:lt
Vririch sc'-ts the values in ascei-iiing order'. Dlslria:,thc so,1ed list from rii;;in riogiain.
lj.) j
{. r'\-riie a Frograni io represent ccmplex nurnl:r-:r'bl.a
str;icti-lre r.viih rl:ai ar:i ilirip.iuar-v as
Il1cnl'l,rlts. T:r,l:e 2 conpiex nui:rbers as input li-.:le.irs:r'inr,:, stiuciure rrai:jabies. F::;s ihe
ccmpiex num.bers to a i.tnction u,hich caicuiatcs sur:r ani retr-ln'i:i l;. r.lisplay tiic sum fiort
anclirer function disp1a,vQ.
ii tl
7. \ri1-rat is the roie of pointers in passinq parameters to functic-rns bi, rel:r"enle? ci,,,e
e.i"nple. liolv 2 dimensional ai:ray carr be ac,;rssetj b.7 a i;oirrter. [+--r,
8. $'r1rat do you mean by opening a data f;ie? Ho',"i is this accompiisheC? Explain fscmt,
iprintl fiead, fu,riie functions, ii--t -;il
- .q' E.rol:iin the stiucture of a- FORTAN prcgrirm. DilTerentiate betrveen arithneiic ancl
iogicai if statement.
l2=.1]
iC. Write a program in FORTAN to recd trvo matrices iroin user, find thejr sum anC di:pie1..
the sum.
[8]
**{<
\
1. a)
b)
design makes programming
points. Also clr;rrv flor,vcharl
2. a)
{2+21,
b) L2l
c) L2l
3. [4]
Ur" ,S"rtdefindd
ur rL rorrl rtrvtrrstj lt..
[g]., ..
5' write down the significance ol arral i1 c.
a program to multiply tw*o jx3 matrix.
*:*:li:_1.:j:1,1,1:- T1i, ( zu,.iion j
.write
;;;;;..
to a us€r denned tt""tlun wrtfl
nrncrion with
argumentvrith array. The resurt is arso dispiayed
_ f.oiimain ( ) function. '.
6' why struclure variable differs flrom airay? wrire e+6)
'-
of ten ernployees. flom main ( ) funcrion and pass
a piogram to input name, posl and
salary --'
(arguments
io
of this function should also a rt*.t
,,*.*e rype user defined fhnction
.. iype). This function r;;#r"J*;?al
, rIffi",H*i::,* :",i,h;l+;;iir"". w.hosq
:::^::yi,:_r #;1";H;"";'il:fil
0,000. rhis modir,id.;;"{;; greater than
saiary is Breater than
_ "# ffi::,'ji'"o is
trzzn,
-r
7,.'WriteaCprogramt1ratreedsastring.fromuser,#ffi:""TJ:i,"i:ffH#i:ii;,ljfr
.Exp1:t:}",::^"yi: .p b".usecr i1 c. How can you u"."*, *r;;;-ents
,iins roi.,t.i
rhe conrenrs of the read string;nro rioirr.r-;;;;;";
upper if any. Use poinrer,o pfo..=,
;;;.,rrrn"*'i"wer case rerrers ro
*li.' 1+6] +
8' write a progralx to input and save ,..o.J,,u" narre, rol[, address
anr] obtained mark * i'
stud.elts. in a binarv file and r;.;.h
;;; ;ii;;i;; ;. record or a srucrenr
mark in highest. The information shoul;
",
whose \ru'La,ruu
obtained
;";;g#;';;'il;.::uLrurr.v1,u* IBt
: 9' writer'a'program'in t"l.
entered Ilom.;i" ',
FORTAN to'clieck whether a positiveinGggr
palindrome
to , .
'keyboard"is a o. rroi. \l,rtt5
Gr"irr ar\ nuqrDer ls paltndrome
palindrometfiir
,,tt i itSl11;,'="3iY Ij."-:' if r"r*rse is equal ro
"*irir'i. !11 lelerse .
--r,UmU..
10.writeFORTRA-- ' ',':to display greatest
i\ prograrn " ' : : ,
-Ql
Su bi::!,
p:lLq p. o g, u",m, n g
_ .
/ Candidates are reoriired to give their
ansr.vers in their own words as
/ Attempt AII questioits. lar as practicable
'-h\--
1
\';rltat is high
le'el Lingr;rge? \'i'hat lr: fie Jrrlcrent
(onrp'rljrprolrlrrirr:in.. rrngrLl;. tyrcs or rrgh rever langLrages? Horv
c ii.irr,r.r,r ;i,,,,; I,'oR rr,.rir.l rr :, ,;
; I - J a'
2. \\ rr:e ur algtrrithnr rn.l fl,y.ch rn or .. t: r ,, r. .*,.^^..
;:l;**lm*i;,:'i:l:",i;'l',,',._1t, ;';11.1:tlil",::;l',l,IJi,1l,l,l;,;:]: w
3. }\rnlie a sl.ntax used il C progranrlring liutguage
[5+5] -
ll:X:X:",m:ji:IH#T::i:
o,cn a irle named REC_'B? ],Tl=-,:=e lccordils
ix,.i,r,_..";,ill,ffi.",,r*:Ii::,
to the outpur drsplale d bero.r: (ro
o I dara where r,,ttst, s -;i;"
vAr t5e;, u"a rotr Corthit;-";i;i;;;;
:li:: ::::,:.r a;;.r_, _/o,
:i.
by;irogram itseifl. "
18 Output is: [10]
:,.
Item Code Description ,
Ilate Quantity
OOlCT Cost I
Comput# 22,000.00
tvl
5 l 10,000.00
Cell Phone 8,000.00
VAT 15% 1U 80,000.00
.,]
I
l otal Cost
i::
Reu.rite program correctly and rvrjte cutput of the given program r.rritten in C
programming larguage be lolv: i8l
q include"stdio.hr
# include*conio.h *
# ilciude;string.h >
void main( )1
I
\
char arl[1$: {'I','o','E',' ', 'P','U','L','C','H','O','W','K' '\;", i '( '
char ar2[15] : "loE, Pulchowk"; ' t
charar3[l$: {{'t'}.('O'},{'E'}, \
9. Dcscribe tiie formaltcd rnput and output staternent in I;OR-TRA-r\ prograrnuring iiinguage
slrltax.
with it's [4]
10 Write a program il FORTRAN to evaluate the follorving series: lSt
series = ]i 1r r I 122 r 1132 f ... ..- ... i l/rl
p 4.ff
'.1
I
I
i
'I
l Difier:niiate int:ror:ier and c-rrlDile;. Elieilrv erpiain in-e si.-os lollowed for ce.,,eloping
ct:nl-ru:Jr sCi:rual:.
ll. l]
2 What ls i datr t'.r, :' F.vplein tn-'op-rrrors available iii C aloi=: l,-,.ith ilr.:iL-- r,r-,r.d:u,ra rn,l
associarivitl,. ' r--
It+ 't1
^ |.fr _:-._
\-"
9
>-^,$-Att are FORTAN's constanrs valabl:si' ..--'*-
anrl i:brar',. i*nctioons.' h:ipLiin. \\'rrie a
-",1::'"