ptupaper.com
Roll No………
Total No. of
Questions: 13]
J-3659[S-1515]
[2037]
M.Sc.
(IT) (Semester- Ist)
PROGRAMMING
IN C (M.Sc. (IT) -102)
Time: 03 Hours Maximum
Marks: 75
Instruction to Candidates:
1)
Section- A is
compulsory.
2)
Attempt any Nine
questions from Section-B.
Section-A
Q1) (15
x 2=30)
a) What
is a compiler?
b) How
will you declare a constant in C?
c) Define
logical operation.
d) What
is the size of int in C?
e) Why
does a character constant require two bytes of memory space in C?
f) Can
we write a C program without # include?
g) What
are command line arguments?
h) How
can you find the number of elements stored in a static array at a time?
i)
How to store some value at desired
address using C?
j)
What happens when the macro
#define
square(x) x* x
Is
invoked as square (z+1)
k) Are
the following statements valid? Justify your answer int m;
K=
(char*) & m;
l)
List down two file opening modes in C.
m) Give
an example of enumerated data type in C.
n) What
is a random access file?
o) Is
the following statement correct? Explain printf(“%d”, printf(“abc”));
Section-B
(9 x 5=45)
Q2.
Write a C program to compute the sun of first n terms (n1) of the following
series using ‘for’ loop. 1-3+5-7+9-…………...
Q3.
Write a C program to convert a binary number to its corresponding octal number.
Q4.
Given are two one dimensional arrays A and B stored in ascending order. Write a
program to merge them into a single sorted array C that contains every element
of A and B in ascending order.
Q5. Given an array of characters, write a program in
C to reverse the array.
Q6. Write a program in C to compute the length of a
string.
Q7. Write a C program that reads a line of text and
counts all occurrences of a particular word.
Q8. What is a macro? Write a nested macro that gives
the minimum of three values.
Q9. What is parameter passing? Explain call by values with an example.
Q10. Write a C program fragment using “do….While”
construct to print out even numbers between 10 to 100 making sure that three
numbers are written per line.
Q11. Write a recursive function in C to compute the
value of xn where n is a
positive integer and x has a real value.
Q12. Describe the syntax for defining the
composition of a structure. Explain the
difference between declaring a structure and defining a structure variable.
Q13. Write a program in C that reads n elements of
an integer array from a file and outputs the sum of all the elements into the
same file.
0 comments:
Post a Comment
North India Campus