0
Programming in C and Data Structures : Question Paper Jun 2012 - First Year Engineering (C Cycle) (Semester 2) | Visveswaraya Technological University (VTU)

Programming in C and Data Structures - Jun 2012

First Year Engineering (C Cycle) (Semester 2)

TOTAL MARKS: 100
TOTAL TIME: 3 HOURS
(1) Question 1 is compulsory.
(2) Attempt any four from the remaining questions.
(3) Assume data wherever required.
(4) Figures to the right indicate full marks.


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 marks)
1 (a) (ii) Integrated circuit was developed in _____ generation of computers.
a) First.
b) Second.
c) Third.
d) Fourth
(1 marks)
1 (a) (iii) 1 gigabyte (GB) is equivalent to _____
a) 1024 MB
b) 1024 KB
c) 1024 GB
d) 1024 TB
(1 marks)
1 (a) (iv) ASCII is a _____ bit BCD code
a) 4
b) 6
c) 8
d) 10
(1 marks)
1 (b) Discuss the basic structure of a computer with a neat block diagram.(6 marks) 1 (c) Explain different types of computers for organization.(10 marks)


Choose the correct answers:

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


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 marks)
3 (a) (ii) Identify valid indentifier
a) a123
b) $123
c) 123a
d) a#123
(1 marks)
3 (a) (iii) a step by step procedure to solve a given problem is called
a) Logarithm
b) Algorithm
c) Flowchart
d) Program
(1 marks)
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 marks)
3 (b) Explain the different phases of solving a given problem using computer.(10 marks) 3 (c) Write an algorithm and flowchart to calculate factorial of a number.(6 marks)


Choose the correct answers:

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


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


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 marks)
6 (a) (ii) How many times the following loop will be executed?
for(;;)
{
printf(''Hello'');
}

a) 1
b) 0
c) Infinite
d) Finite
(1 marks)
6 (a) (iii) What would be the output of the following code segment?
for(i=1;i<=5;i++)
{
if(i==3)continue;
printf(''%d'',i);
}

a) 12
b) 1245
c) 1234
d) 245
(1 marks)
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 marks)
6 (b) Differentiate between while and do-while statements, with an example for each.(8 marks) 6 (c) Write a 'C' program to calculate area of circle, rectangle and triangle using switch statement. Area of circle=?rr, Area of rectangle=lengthĂ—bredth, Area of tringle=0.5baseheight.(8 marks)


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;
if(n>0)
{ x=x+1;
y=y-1;
}
printf(''%d%d'',x,y);

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

a) 0
b) 1
c) Infinite
d Finite
(1 marks)
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 marks) 7 (c) Write a program that accepts a string and check whether the string is palindrome or not.(8 marks)


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 marks)
8 (a) (ii) OpenMP supports _____
a) Multi-threaded
b) Shared memory
c) Both A and B
d) None of these
(1 marks)
8 (a) (iii) Which of the following is not a synchronization construct?
a) Single
b) Master
c) Section
d) Critical
(1 marks)
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 marks)
8 (b) What is parallel computing? What are the various motivating factors for parallelism?(10 marks) 8 (c) What is Open MP? Explain the open MP programming model.(6 marks)

0  upvotes

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.

Search

Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More