Computer Programming
Computer Programming
1l
,/ Candidates are required to give their answers in their own words as far as practicable.
,/ Attempt All questions'
'/ Thefigures in the margin indicate Full Mqrks.
/ Assume suitable data if necessary'
b)' Vfhy is algorithm and flow chart development important in problem solving? Write an .
algorithm-and draw flow chart to test a number entered by user whether it is even or
not. 12+31
2. a) What is the identifier? What are the ways to give value to variable? Explain with
example? [1+2+1]
b) Explain about input and output function available in C with syntax and example of
eachpart. [Z+2+2]
I a) Write algorithm, draw flow chart and program to input a number check it is
Armsffong or not. [2+2+21
b) What do you mean by selective and repetive statement? Why do we need break and
continue statement? t2+21
4. a) What do you mean by "call by value and call by reference"? Explain it with suitable
example. L4l
b) Can we pass whole array element from the function? Write the program to pass an
array to function and sort them. t6l
5. a) Write a program that finds the largest word in a given sentence. I4l
b) Differentiate between the methods of passing argument to function with example.
What are their advantages and disadvantages? t6l
given in
6. What is structure? Why is it necessary? Write a program to add two distances
feet and inch format rlring structure. [1+1+6]
ff
int mainQ {
if( ! NULL )
{. prinff("C programming is easy");
else
printf("C programming is not easy");
return 0 ;
)
b) Write a program to calculate the length of string without using string handling
function. t4l
8. A file name employee.txt stores employee name, employee id and employee salary. Write
a program to diiplay the detail of all employees in the order of their salary. [8]
q read 10 integers from user and short them in ascending
It I
,I'RIBHUVAN
A2 LNIVERSITY
INSTITUTE OF ENGINEERING
Examination Control Ilivision
2074 Ashwin
h
average = sumlMAX;
pr ntf{ "7o06. 2f ', ave ra ge}
i
;
return 1;
,
3" a) Compare if-else-if la<Ider and switch construct with example and flowchart.
isl
b) ]vrite a Program in C to generate following pattern using unformatted inpuloutput
functions onlv.
[-{]
al
t\
FF>
PFPP F
aaaaa aa
LLLLLL LLL
4' v/rite a program in c to find out whether the nth term
of the Fibonacci series is a prime
number or not' Read the value of n from the user and
display the result in the main
function- use separite user-defined functions ro generare
r#';in il";;;;; i.rr" *0,"
check whether a nurnber is prime or not.
t8l
t 5' a) How two dimensionar a*ays are
created i1,c plgramming? write
NxN and find sum of botir ailgonJ.. -' to
squaxe matrix of size yvrrre a program
to read
t) in C to check whether a given [z+4]
xilHffif;ffi srring is parindrome or nor
using user
6' What are the advantages of
using poinrer in C I4l
largest -r"."*r-r'J'f;';", n1q1m*:ng?_ Write a program in C to
.ontui'ing N:"r"m"nts using
ff*,:::t* concept of
7 ' Explain structures and nested
skuctures? create a stmcture to hold
12+41
x+iy' write a program that uses any complex number
third cornplex number which
tt" t*"t* to read two comprex numbers
and dispray a
ir1rr" *Jiiprication orth"
8' """r* ""rpl;;;'#;;t t3+51
"' ,H;lHoT*fr:J*ut/output tuncrions used with data files
in c? Explain with
b)
write a program in c to read
integers from user until user
I4l
say.s..no,,. After reading
odd numb." io-u nr" the
lff.Hff.r*le "u'";dd;;'", *" even number to file
9' when can we use recursive functions? I4l
programs? Differentiate Iev ao we need conftor srarem€nts
statem€nts in com;
between do...while *a ror computer
rrui"i"-;,:'.*",
l0' what are the characterisrics of F'RTRAI [2+2+z]
to calculate the value of n bv lggramming? write aprogram in F'RTRAN
evaluating
;;;h,r,"
the rottwing irrizJ-**r. '
t8l
-\- '1 7 1 \
n=+(t--l
s*s-l*A-..,)
*,r*
05 TRIBHUVAN UNIYERSITY
,t
INSTITUTE OF ENGINEERING
Examination Control Division ALL (Except B. Arch)
2073 Shraw&n
Fy?irsl:_9g_*sggrlss*jss(9ruJ)
Candidates are required to give their answers in their own words as far as practicable.
Attempt AIl. que stions.
TheJigures in the margin indicate Full Marks.
Assume suitable data if necessary.
4. a) Why do we need control statements? Compare switch and if-else-if ladder with
example. .
t4l
b) Write a C program to display all characters between a given ranges. t6I
f. a) What are the advantages of using functions? Differentiate between Library functions
and User-defined functions with suitable example. tsI
b) Write a progfilm to check wtrether a given number is Armstrong number or not using
recursive funetion. t5l
a) Write a C program to read two strings in main and compare them using userdefined
function.rDisplay appropriate message from main. t4l
b) What are overflow and underflow elrors in context of array? Write a progffim to add
corresponding elements of two arrays. The results should form a new array. [2+4]
7. a) Why should we prefer structure over array? Explain nested structure with example. 12+41
b) Write a progfitm to read name and roll number of 48 students from user and store
them in file. If the file already contains data, your progftlm should add new data at the
end of the file. t6l
8. a) What is the structure of FORTRAN program? tsl
b) Write a FORTRAN program to read n numbers and display largest number among
',*
05 TRIBHUVAN UNIVERSITY
INSTITUTE OF ENGINEERTNG
Examination Control Division
2A72 Chaitra
1. a) What is a flow chart? Use the various commonly used floW chart symbols. How does
a flow chart help computer programming? [2+2+21
/
r'.
r'
1. a),,
b)
3. a)-
l;. a_-
.,
i
b) Write
the element
8. List different tlpes of stsdard VO used iu C. Write aprogrysl to write name, roll
age of five shrdents into a disk file aame " STUDENT.DATU.
P.1.21,
05 TRIBIIUVAI.I UNITERSITY Exam..
. INSTITUTE OF Level BE Futll!(!rLsl 80"
Examinaticn, Prograqme AII @xceptB. Arch) P+s,! Mar.F
2A7L Y.ear /'Part Itl Tiine' 3 hrs,
b) WriteaCprogrqm that
computer- rearra[ge tlren@es t4I
7.. Iltustate with example that "Array* is indiiectly a pointer". Write program to calctrlate
sum and average of integer numberi between M'and N (where value of M and N are read
from keyboard) usingpointer- 14+4J
8. Write a program to contiduously read rvtme, age and salary of a worker and write it into a
file rmtiiusir confirmsio end- Then read n from user and display the n6 record in the file.
Details of worker must be represented by a sEtrcture. tl
9. a) Compare arithriretic and logical if staternents inFORTRAN U1
b) Write a FORTRAITI prograrn to display nature of roots of a quadratic equation.
Calculate and display {he roots, if they are real and equal. pl c1
I :1. {.*
P.1.22
lj
05 TRIBHUVAI.IUNIVER.SIfi Eram.
'l
Level Fult [Grks 8
program
W.ritp qmtan,
i) pintf( )
:1..j, , ,
'r;...-: '-
13+71
.i;;
'Ir i'
f.
:: ': '
of n+uqber uili.l the , . .
I I . . ,,i ' i ::.: :. {2+2+4J
:J.: a) Write a order.
3,'sales.
,. ,Each sales of
Calculate .-
sort them ia ascending ordei of salqry and store the sorted record to a binary file. Display
the details and rank of employee given by the user. . t8]
g. a) What do you mean by formatted and unfonnatted input/output statements in Fortran .
and also give suitable example which explain the concept of Formatted UO. t8l
b) Write the program to convert a binary number to a decirnal number using Forkan
progra@ming language. t4l
:
t**
P.1.23
05 TRIBHUVAN I.JNIVERSII'Y Bxam. c11 r
INSTITUTE OF ENGINEERING Lev-el- Full Marks 80
All ( Except'
- Examination Control Division Programme
.
Pass Marks 32
B. Arch ) ;, "
2070 Ashad Year / Part Ill )t, Timc 3 hrs.
't I
I
- I
-l
-'1
I
-1
t2 l2o
, .
t. Why do we need programming language? Write down the advantages and disadvantages of
high level and.low l9v9f programming languages. Write an algorithm and flow chan to
check whether the given yedr is a leap ]reaI or not; [Hint year is a leap year if it is divisible. -
ty 4 not by 100 and by 400.1 ^ 12+3+51
2. What do you mean by operators? Explain differcnt operatorc along with their precedence
and associativity. Write a program to count the number of vowels in a string you ar€ not allowed
touse library functions. 12+2+61
3. What is a nested if-else statement? Explain it with an example. Write a program to find the
largest ofthe three numbers using a nested if-else statement. U+2+11
4 Compare while loop, for loop and do-while loop. Write a program to evaluate the following
0.001.
series until the difference between the two terms is less than [3+7]
13 xt
.S-=f+3-+-+...
" 3., 5!
5. Explain why we need function in programming, Write a function to check whether a
number is prime or not and use the output of that function to print prime numbers from I to n
entered tiy the user. 13+71
6. What is a pointer? Write down the relationship of aray and pointer. Write a function that
takes string as an argument and return the number of characters in the string. Also return by
converting the string to upper case. Don't use libraryfunction. [l+2+71
; How is nested structu€ formed? Explain with example. Write a program to perform
additioq subtraction, multiplication and division of complex numbers. Make separate
functions foleach operation. tl+2+77
E. What are binary and text frles? Write a progftm to write any structure information in a
binary file andtotead and displayillater . Make a menu driven program to read and display
information from file. [3+7)
* *tt
t
,'t*
:
r' Candidates are required to givi their answers in their own words as far as practicable.
{ Attempt All questions.
{ The/igures in.the margin indicate Full Marlcs
/ Assume suitable data if necessary.
b) What are the difference between formatted and unformatted UO statements? Describe
with proper example. t4l
!*Y exylain importance of break and default statements in swirch statements. tll'
b) Write a C program to display following pattem using unformatted output statements: l7l
P
Pu
PUL
PULC
{'
Pul.cH
pulcHoW
PULCHOWK
/
4.\af Dqfine "firnction definition" and write the program to find the sum of tu,o numbers
using user-defined functions. t{L
yI Wtlm;t do you mean by "call by value and call by reference" along with suitable
: -:
examFle? I{]
S/Canwe pass whole array element from funotion? Write a program to display only those
students infomration which are passed. Use separate function to check the result of
student. The information of students like Name, Roll No, Address and Marks are passed
from mainArnctions and pass to functions using array t)?e arguments. L2+8I
M:.t--
A.
-/'r{nxplain
the use of t5,pedef of keyboard in structures. 12)
b) the need.of nested structure. Writeia C program to convert data in BS to data
y-/ /xplain
in AD using structure. Use the data difference of current'data. tl*S]
t3]
t5l_
l4J
t4l
t4l /
Srf'W;te a FORTRAN program to read m*n matrix, transpose it and display both the
**
il
i ,]
ri
,..-,,,,,.. . -. . -r -.-.,',i.J' ;i
-ll.
li
I
i
:
''t:; .
-l
I
I
I
s
')
/ Candidates me required to give their answers in their owr: words as far as practicable.
{ Auempt.AlI questions.
l
I
Vt Dry"rentiate between high level and low level. Explain the steps of solving a problem I
I
using computer- [4+4]
'
2. Consider a statement
scanf ("8s", str) ;
Where st is a string variable
In above statement, why '&' symbol is not used? Can we input string with space in this
statement? If not, why? t4l
\,
fu \Vrite a program in C to find all possible roots of a quadratic equation a:r2+b>i+c=0. t8]
-.$--Wlile
'r" v $to:un sieniticance qf u'pin()$n-ction in Ci Diftereajate betwe_en pas,!y.lalrl9;,_ :e
-
and pass by reGrEnce arguments. Describe both witJr meaningfuIexample. ! 12+61
{ 5,. Explain how array can be passed to firnctions. Write a program that passes an array to a
\/ firnction and print the largest and smallest element.
\ [2+61
-Q How are sEuctures different from arrays? Create a structLue in C to store the name of a
v batsman, runs scored and no of times the batsman in dismissed. ln the pregram, read the
data of five players and display the batting average of the player whose name is entered
totalruns/total-dismissals. ,t
by the user. Batting average is given by [2+61
Wnte down advantages of pointer. What type of arithmetic operations can be
t l- implemented in pointer? Also describe the relationship between array and pointer with
appropriate syntax and examples. ,f [2+3+3J
8. Write a progr.un in C, to read the following information for 96 shrdents.
Student Name, Student roll number, Marks obtained(in 100)
Record all data in "ioe.txt" file, and program should print roll number and name of
student who have obtained greater than or equal to 40 marks. t8]
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. 14+41
,
-
I
?
/programto convert list of temperatures
/in Centigrade to Eahrenheit .
*inclucie stdio-h;
int main ( )
8'
L .rL.
{
int i, n-3;
float celc Ini , faren In] ;
6sg1i=0; i<n; i++) :l
{
. Print ( "CeIc t tdl =" )
scanf ("td", ceicIi] ),'
]
' ' t
i6nlrert (berc, faren, n) i '
for (i=0; i<n,. i++) print lfarenii) ) ;
break;
);
void convqct:(.ftoat,c.eAlJ, rftroat. fa:r[], int n)
1
v
['+.1
l/- ***
j
i,
/
"05 TR]BHWANUNIVERSITY Exam, Resular / Back
INSTITUTE OF ENGINEERING Level BE FulI Marks 80
Examination Control Division All (except
Programme B.Arch) Pass Marks 32
2058 Baishakh Year / Part ilr Time 3 hrs.
I
t' Candidates are required to give their answers in their own rvords as far as practicable.
{ Attempf&.qtrcstions.
,/ Thefigures in the margin tndicate Fu!!@fu.
/ Assum.e suitable data if necessary.
1. What is high level language? Write different types of high level programming languages with their
examples. Hpw compiler is different than assembler programming language? [1+4+3].
'.'2. What is a pseudo code? How is it different from an algorithm? Draw the flowchart to solve the
multiplication of two matrices. U+2+51
l. Write a hierarchy of operations of the following expression in computer programming C: IEOF tt
B-Salary + Daily-Allowance > 8000&& eligible_code =: 1tt nelpay>10000. Write different forriraited
input output used rn For Tran programming language. [4+4]
4. Write a program.in C to calculate the frequency (F) for different values of cap.acitanees(C), for a certain
electrical circuit. with an inductance (L) and resistance @), the darhped natural frequBncy is given
by-F:./11tll.Ci-Cn'zl+C11.-It is.iequired to study ttr'e variation ottiis frequencyw^ith capacitance
starting frbm 0.0.1 to 0.1 in steps ofb.01, and calculationlhould be,dohe.u$ing uqbr defined.function. [8]
5. Write a syntax in C- programming wittr example of the following: "scanf', single statement
"do....while", "strcpy'', structures with arrays. fax?J
6. What are the rules that govern the passing of arrays to user defined functions? Compare'"user defined
functioni' and "switch" in C- programming language. [3+5]
7. What are the importances of "Pofutters" in C programming language? Write the output of the following
program. L4+41
# include<conio.h>
voidmain0
, t int k; int.a[ ] = {1, 2,.3};.int*b[3]; int **c[3];
int***d[3] ; int* **,Fe[3J. 1o1**** *,f[3];
clrscO;
for g =' O;t<:; t++1 i
{ blkl.: q+ hclkl :b + k; d [k] : c + k'
e[k]:d+k;f[k]:e*ki
il
fo. (t --L;t.3;k+-r)
t printf ('oA3il', *b[k]; printf ("%3d", **c[k];
printf ("%3d", ***d[k]; pintf ("Yo3d', ****e[k];
Printf ("%3d\nr'
*****f[k] ;
)
)
8. Write a progtam to read name and age of 10 different students as the two members of a structure named
"studeirts". Display the name and corresponding age of the students sorted in an alphabetical order. t8]
g. What are the inputs and outputs functions used with data frles? Explain, error handling process d-uring
reading and writilg in a data files. t5:31
i0. Write a program in ForTran to test whether the acceptcd year is leap year, or not. (Hint: A year is
leap year if: the year is divisible by 4, but not by 100 or the year is divisible by a00) t8l
rl
:1. {.*
I
I
t
iltl
l
I
tilr
i
I
\
,,:a
1. Define algorithm. lVrile an algorithm for finding largest and smallest values from a list. [2+6J.
2. Draw a flowchart and algorithm to find roots of a quadratic equation (ax2 + bx + c : 0).
Include all three conditions of the determinant. I [10]
3. Write a program to read values from user and find sum until user types 0, also display
sum and average. t8L-
4. &Ihy prograillmers prefer using user d.efined functions? What is merits and demerits of
using functions in program? Differentiate actual and formal parameters used in functions.[3+2+3J -
5. Write a pro$am to take a list of values from user into an L$ay. Pass the list to a function
which sorts thq vaiues in ascending order. Display the sorted list from main program. [315]
6. Write a proglam to represent cornplex number by a structure with real and imaginary as
members. Take 2 complex numbers as input from user into structure variables. Pass the
complex numbers to a function which calculates sum and returns it. Display the sum from
anothgr tunction displayQ. [10]
7. What is the role of pointers in
passing parameters to functions by reference? Give
example, how 2 dimensional array can be accessed by a pointer. 14+41
8. \lhat do you mean by opening a data fiie? Iiow is this accomplished? Explain fscanf,
&rintf, fread, fwrite functions. [l+3+4]
g. Explain the skucture of a FORteX program. Differentiate between arithmetic and
logrcai if statemenl 1Z+Z1t
10. Write a program in FORTAN to read two matices from user, find their srmr and display
the sum. t8l
**rf
L
i
I
i
ir
i
I
i
1 I
-t I
'1
I
I
I
I
-''l
i
I
-t
i
I
I
I I
I
1
I
a.**J 05 IRIBHUVA}ITJNIVERSITY Eram. RegulariBatk
INSTTTUTE OF ENGINEERING Level BE tr'uU Nlariis 80
{, Candidates are required to give their answers in their oum words as far as prdcticable.
{ Auempt All questions.
,/ Thefigures inthe margin indicate Fult Marks.
/ Assume suitable data if necessary.
1. What is high level language? What are the different types of higfu lwel languages? How
computerprogramming language C is different from FORTRAI.I? [1+]t{
2. 'Write an algorithm aud flowchart of the distance betwee,n two points (xr, yr) and (x2; y2), I
I
govenred by formula Dz = (xz - *r)' + (yz- y1)2. Where, xr, xz, yr, yz ari given by user,
I
.::... ... ,
ts+fl'"
3. Write a qmta:r used in:C prograinming teinguage for the followings: tHI
a) scan( ) b) while c) stuct
4. What are the significant meanings of '&' and '*' established in C programming? How .
car you differentiate between 'ciIIed by value' and 'called by refereuce'-with irt
C programming?. : "*iropt.
t4+61
5. State with example, how switch () function differs from user defined function in
computerprogramminglanguage C. t4l
6. Write a pseudocode to find the standard deviation of an array of values in C
'
programming. The array ele,ments are read from the terminal. U'se user defrned functions
to calculate standard deviatipn and mean. Standard deviation of n value is given by ,EI,
1-',.'E;;;
,
r'=
1= ,
Where x, is the'mean of the values.
'Write
7 . prograur in C programming language accor<li.g to the output displayed below: (to
a
open a file named RECORD.txt for the n number of data where Cost, Service Charge 5o/o,
VAT 15%, and Total Cost must be calculated by program itself). [0]
Output is:
Item Code Description Rate Ouantitv Cost
OOlCT Computer 22.000.00 5 110.000.00
007M Cell Phone E,C'00.00 IO 80.000.00
VAT 15-"/C
Sersice Charge 5%
Total Cost
Thank You!!! Visit Again
I
-1
1
I
8. Rewrite program correctly and write .oritput of the glven proglam written in C
programming I anguage below : t8l
# include stdio.h
# include conio.h i
I
void main( );
'{ : {'t"'o"'E"'
char arl[1 1]
char ar2[15] = "IoE, Pulchowp';
"'P"'IJ"'L"'C"'Hi,'O"''W"'K',};
char ar3[1 1] = { {'I'},{'O'},{'E'},
{''},{'p'},{'u'},{'L'},{'c'}, {'H'},{'o'},{'w'}, {'K'};
clrscsr( );
{printf ("\nArray l: o/oc\n", arl);
riit"tf Cf"arrayz:o/*Yl',lr2,)i' :
I
retum 0
)
9. Describe the formatt$ inpu! and output statement ip IOR'[RAI.{ programming language
with it's syrtax. I4l
10. Write a program in FORTRAI.{ to evaluate the following series: t8l !
,I
'22 Tir ":,'..'-{1IUNIVERSITY r- ./ E:r ik
INSTITU' - ,T ]N:-iNEERI]' BE Fuii ]i: rks 80
'
r., i aminal l. * :..Onti'Ol [)iv.i:ii :: BEL, BEX,
Plls..; .r. I,i::ks 32
BCT
2CSi ihra;,'an \'ear lPzrt I/i Ti;:re 3 hrs.
b) Write a program in C which calculates F, where p,= (a t bn)/ c!,and n is. an integer.
For designing above program, use two functions, one calculatbs factorial and other
calcuiates power of anumber. t6l
s. a) Wlry pointer operator is called indirection operator? Give example. t3l
b) Write a C program to check ryhether the given sfting is palindrome or not. Palindrbme
shorild be chEcked by user defined function. tsl
6. a) What are the differences between malloc( ) and calloc( ). Wheu we use realloc( ). [2+1]
Write a C program to read n integer numbers in an array dynamically and create two
functions to sort in ascending and descending order and display the result in the maiu
,, function. tsl
'7." a), Discitss [6r'r arra] of strings can be stored in.ai-ray of pointer variable. t3l
b) Write a C p'rrsglam to enter the strings uatil the user enteis "end'; and display the list
of string in aiphabeticai order using two dimensional array of character usirg
flrnction. tsl
-t!
i
-l I
I
marks is float. Also display aillhe records stored in the file. Write. a.progarfl to keep t\
the records of 10 subjects and display allrbcords from the file. t6]
,c
nl i
"{
-- r' 1.- :-*'r'+-;lit,,!a;ir-::..1ilt;:,.-:;.i:.f ,j;. l-: ,.,,.,-.)t.. '., ,. ..- 1 -' -.. ::::-:1:r-iE:i1,:.i:1:i:::-_:*t',:-r ..- .:..i:.-:::-::. h :.i: :
)
22 TRIBHUVAN UNIVERSITY Exam.
INSTITUTE OF ENGINEERING Level BE FullMuks 80
Examination Control Division Programme BCT
BEL,BEX,
Pass Marks 32
2055 Shrawan Year / Part vl Time 3 hrs.
I
/ Candidates are requhed to give their answers in their own words as far as practicable.
{ Auempt All.questions.
t Thefigures in the margin indicate Full Marlis.
r' Assumb suitable data if necessary.
1. a) Iilfhyis C programming most commoqly used in simulation? Do you agree that the
compilercan produce the executable file directly itself? Elaborate your .[2+2]answer.
b) Write an algorithm and a flowchart to read a five digit number and check whether the
I.- number is a palindrome or not. B+21
.2. a) List different operators with their corresponding associativity in C. Mention the size
and range of signed long int and float. [2+l]
b) Write an interactive progrun that readi positive numbers until user enters "no" and
then sum the numbers divisible by 4 that lie between the range of 10 and 50 and
frnally display the count and the average value. I51
3; a) IllusEate the formatted VO sking data. Why don't good' programmers prefer
goto-statement? Compare switch over else if-ladder. [+1+l] .
E
b) Write a program using recnrsion to comlute the sum of the followind ieries: tsl
12 -22 + 32 - 42 ..... + (-1)*' n2 without using pow( ) function. You should read the
value of n from the user.
4. a) How does a function optimize resources at the progranrmer and thq machine side?
How does a fr:nction retum value? Illustratewith example. : [+2]
b) Write a program to read number and call a function till 'yes' is entered by the user.
You should count and sum the numbers using static variables in the function and
return the ?verage to the main fuuction._ ,, t5l
5. a) Compare'array with pointer sptactically and physically. t2]
.b) Write to compute the deterrrinant of a square matrix of nth order and then
a program
check whether the given mgtrix is singular or not. You need to have two frmctions as
r::
t- -. read ( ) andprocess'-(-:'
-' '-,. ). '- , [6t - 1..
I --'
I.'.,:,
6. a) \Mhy do we need IIMA? Explain the significance of calloc( ) with example. [1+i]
b) Write a pro$am that reads positive integer nrunbers into an aray dyna:nically and
pass them to a function where odd nudrbers are filtered into another array and disptay
the array containing odd numbers in the main functiou. l6l
7. a) Mention the applications of pointer. Illustrate the invalid and valid pointer arithmetic
on both data variable and pointer variable. ll+11
b) Write a program that dynamically allocates twb different strings and pass them to a
function where the second sh'ing is compared with the reverse of the first string on the
chanicter basis and display the message in the main function. You are'not allowed to
u1e.!he sting functions. t61
-8. a) 'Illushate the self referential sbucture and the position pointer. ''': ,F+tl
I b) Write a prograur that illustrates passing function address to other functions directly
and using Pointer. l6l
9. a) Sketch the bits assignment in a stuctue if.you have 7 bit fields of 5 bits length each.
Justify the bytes consumption by above stnrcturc with reasoning. t2l
b) Write a progrurm to compute any two instant memory spaces in a format (Kilobytes:
Bytes: Bits) using stnrcture. Build functions to add and subkact given memory spaces
- where 1I(B : 1024 B and 1B=8 bits and dispiay the results in the main functien. t6l
TT!
b) Write a program that first appends the customer records ia a binary file and display
the number of customer records as well as the contents from the file. The file name
should be given by user and display if it does not exit. l6]
i
I
I
I
I
I
-1
I
I