Roll No……
Total No. of
Questions: 09
Paper
ID [MC102]
MCA
(Sem.-1st)
PROGRAMMING
IN C (MCA-102)
Time: 3 Hrs. Max.
Marks: 60
Instruction to Candidates:
1.
Attempt any one question from each Sections A, B, C & D.
2.
Section-E is Compulsory.
SECTION-A
1. (a) What are the four classes of data types supported by ANSI
C.
(b)
Explain stepwise the automatic type conversion for the following.
Int I, x;
Float f;
Double d;
Long int I;
X=+I *
f-d;
2. (a) How can enum be used to create user defined data type?
(b)
Write a program that reads a string including blanks spaces until ‘\n’ is
encountered.
SECTION-B
3. (a) What are the differences between while
& do while construct.
(b)
Write a program that accepts a string, reverses the string and prints it.
4. (a)
Write a program that finds the largest of the three numbers using nested if
statement. Also give its flowchart.
(b)
Write a program that uses a recursive function to print Fibonacci sequence.
(Fibonacci sequence is 0,1 ,1 2, 3, 5, 8 and so on)
SECTION-C
5. (a) What is the difference between a
structure and a union.
(b)
Write a program that defines a structure book having members name, author and
price and compares two variables of type book.
6. (a)
Write a program using pointers to compute the sum of all elements stored in an
array.
(b)
Explain the difference between Call by Value & Call by Reference.
SECTION-D
7. (a) Explain fseek( ) function.
(b)
Write a program that sorts an array using bubble sort method.
8. (a)
Write a program that writes all reads ten numbers and writes all odd numbers to
a file ODD & all even numbers to a five EVEN.
(b)
Explain malloc( ) function using an example.
SECTION-E
9. (a) What will be the output of the
following
Int a=5, b, c;
B=++a;
C=a++;
Printf(“%d %d %d \n”, a, b, c, );
(b)
What will be the output of the following
(i)
Printf(“%11.4e”, -98.7654);
(ii)
Printf(“%-20.10s”, “NEW DELHI 110001”);
(c)
What is the difference between a character ‘A’ & string “A”.
(d)
What is the difference between a static and auto variable?
(e)
Define register variable.
(f)
Explain strcmp function.
(g)
What is a preprocessor directive?
(h)
What is type casting?
(i)
What will be output of the following
Float y;
Int fem=995, mal=1000, x;
X=fem/mal;
Y=(float)fem/mal;
Printf(“%d %y”, x,y);
(j)
What is the scale factor in pointer variables.
0 comments:
Post a Comment
North India Campus