VTU First Year Engineering (C Cycle) (Semester 1)
Programming in C and Data Structures
June 2012
Total marks: --
Total time: --
(1) Assume appropriate data and state your reasons
(2) Marks are given to the right of every question
(3) Draw neat diagrams wherever necessary

Choose the correct answers:
1 (a) (i) The first mechanical computer designed by Charles Babbage was called _____
a) Abacus
b) Processor
c) Calculator
d) Analytical engine
1 M
1 (a) (ii) Integrated circuit was developed in _____ generation of computers.
a) First.
b) Second.
c) Third.
d) Fourth
1 M
1 (a) (iii) 1 gigabyte (GB) is equivalent to _____
a) 1024 MB
b) 1024 KB
c) 1024 GB
d) 1024 TB
1 M
1 (a) (iv) ASCII is a _____ bit BCD code
a) 4
b) 6
c) 8
d) 10
1 M
1 (b) Discuss the basic structure of a computer with a neat block diagram.
6 M
1 (c) Explain different types of computers for organization.
10 M

Choose the correct answers:
2 (a) (i) A collection of 4 bits is called
a) Nibble
b) Byte
c) Word
d) Record
1 M
2 (a) (ii) Which of the operating system is not GUI based?
c) MAC
d) DOS
1 M
2 (a) (iii) Which is a secondary memory device?
a) Cache
b) RAM
c) Registers
d) Floppy disk
1 M
2 (a) (iv) Which of the following is not a layer in the OSI model?
a) Presentation
b) Transport
c) Session
d) Communication
1 M
2 (b) Enlist various secondary storage devices. Explain how data can be stored and retrieved form CD-ROM.
6 M
2 (c) What is an operating system? What are the major function of an operating system?
6 M
2 (d) Write a note on the need for networking.
4 M

Choose the correct answers:
3 (a) (i) C' language is a _____
a) Structured language
b) Object-oriented language
c) Machine language
d) Assembly language
1 M
3 (a) (ii) Identify valid indentifier
a) a123
b) $123
c) 123a
d) a#123
1 M
3 (a) (iii) a step by step procedure to solve a given problem is called
a) Logarithm
b) Algorithm
c) Flowchart
d) Program
1 M
3 (a) (iv) The range of char data types on 16 bit machines is:
a) -126 to 127
b) -128 to 127
c) -127 to 128
d) -127 to 127
1 M
3 (b) Explain the different phases of solving a given problem using computer.
10 M
3 (c) Write an algorithm and flowchart to calculate factorial of a number.
6 M

Choose the correct answers:
4 (a) (i) The operator % yields
a) Quotient
b) Remainder
c) Percentage
d) Fractional part
1 M
4 (a) (ii) Evaluate the expression 10! = 10 || 5 < 4 && 8. The result is:
a) 1
b) 0
c) 2
d) 10
1 M
4 (a) (iii) Which of the following bitwise operator shifts their first operand to its left?
a) &&
b) <<
c) >>
d) ^
1 M
4 (a) (iv) If a=10, b=5. Find C=++a-b. The result is:
a) 5
b) 7
c) 6
d) -6
1 M
4 (b) Explain precedence and associativity of operators in 'C' with an example.
8 M
4 (c) What is type conversion? What are the different ways of type conversion? Explain with an example.
8 M

Choose the correct answers:
5 (a) (i) What is the output of following program?
#include stdio.h
void main ()
{ int num;
for(num=0; num<=10; br=""> {;
printf('%d', num);

a) 012345678910
b) 11
c) 10
d) 01234567891011
1 M
5 (a) (ii) A for loop with no test condition is known as _____ loop.
a) Finite
b) Infinite
c) While
d) Do-While
1 M
5 (a) (iii) In 'C' which of the following is not a storage class specifier?
a) Static
b) Auto
c) Const
d) Register
1 M
5 (a) (iv) Which of the following is the last character that is stored in a char array in 'C'?
a) \0
b) ULL
c) 0
d) /0
1 M
5 (b) Describe the different ways of passing parameters to functions.
8 M
5 (c) Write a 'C' program using functions, to compute the sum of N numbers.
8 M

Choose the correct answers:
6 (a) (i) Which of the following command will place the program control out of the loop when it gets executed
a) goto
b) Break
c) exit
d) continue
1 M
6 (a) (ii) How many times the following loop will be executed?

a) 1
b) 0
c) Infinite
d) Finite
1 M
6 (a) (iii) What would be the output of the following code segment?

a) 12
b) 1245
c) 1234
d) 245
1 M
6 (a) (iv) The minimum number of times the do-while loop will be executed
a) 0
b) 1
c) 2
d) Both A&B
1 M
6 (b) Differentiate between while and do-while statements, with an example for each.
8 M
6 (c) Write a 'C' program to calculate area of circle, rectangle and triangle using switch statement. Area of circle=?*r*r, Area of rectangle=length×bredth, Area of tringle=0.5*base*height.
8 M

Choose the correct answers:
7 (a) (i) In the following segment of code, what will be the values of x and y after execution, if n assumes a value of zero(0).
x=1; y=1;
{ x=x+1;

a) 0, 0
b) 1, 0
c) 0, 1
d) 1, 1
1 M
7 (a) (ii) Arrays can be initialized at
a) Compile time
b) Run time
c) Both A&B
d) None of these
1 M
7 (a) (iii) Strncmp() function has _____ number of parameters
a) 2
b) 3
c) 1
d) 4
1 M
7 (a) (iv) How many times the follwing while loop is executed?

a) 0
b) 1
c) Infinite
d Finite
1 M
7 (b) What is an array? Write a program to print the sum of two 1-dimensional arrays and store the result in another array.
8 M
7 (c) Write a program that accepts a string and check whether the string is palindrome or not.
8 M

Choose the correct answers:
8 (a) (i) Parallel computing is _____ execution of instructions in a computer
a) Simultaneous
b) Serial
c) Accurate
d) Complete
1 M
8 (a) (ii) OpenMP supports _____
a) Multi-threaded
b) Shared memory
c) Both A and B
d) None of these
1 M
8 (a) (iii) Which of the following is not a synchronization construct?
a) Single
b) Master
c) Section
d) Critical
1 M
8 (a) (iv) Which of the following is the correct syntax of specifying OpenMP threads in C?
a) #pragma omp directive[clause1][clause2] [clause n]
b) #pragma openmpdirective[clause1][clause2] [clause n]
c) #define omp directive[clause1][clause2] [clause n]
d) #define pragma omp directive[clause1][clause2] [clause n]
1 M
8 (b) What is parallel computing? What are the various motivating factors for parallelism?
10 M
8 (c) What is Open MP? Explain the open MP programming model.
6 M

More question papers from Programming in C and Data Structures