Thursday, October 2, 2014

2013-14 (EVEN SEM)

B.Tech.

(SEM. II) THEORY EXAMINATION 2013-14

COMPUTER PROGRAMMING

SECTION-A
 

1.      Attempt all parts of this section.                                                        (2 X 10 = 20)
a)      Why ‘C’ is called structured programming language?
b)      Explain the output of following:
#define SQUARE (x) x * x
void main ( ) {
int i;
i = 81/SQUARE (9);
printf(“%d”, i); }

c)      What is ASCII Code? Write ASCII Code in 8 bit for word “Hi”.
d)     Differentiate between conditional operator and switch.
e)      What is void pointer? How is it different from other pointers?
f)       What is function prototype? Why is it required?
g)      Write any four features of LINUX operating system.
h)      Find the output of the following code:
void main ( ) {
switch (0) {
case 0: printf(“0+3”);
case 0+1: printf(“0+5”);
default: printf(“Wrong Input”); } }         

i)        Define linker and explain its role in ‘C’ programming.
j)        Find the value of Y (assume Y is integer data type)
Y= 4 * 2 / 4 – 6 / 2 + 3 % 2 * 6 / 2 + 2 > 2 && 4 !=2

SECTION-B

2.      Attempt any three parts of this section. Each part carries 10 marks. (10 X 3 = 30)
a)      Draw a neat diagram of digital computer and explain the role of each functional unit.
b)      Convert the following:
                                                        i.            (B5C)16 – (92A)16 = ( ? )10
                                                      ii.            (10101011101.011)2 = ( ? )16
                                                    iii.            (916.125)10 = ( ? )4
                                                    iv.            (16)8 + (45)8 = ( ? )16
                                                      v.            (123)5 = ( ? )3

c)      Differentiate between pseudo code and algorithm. Write the characteristics of an algorithm. Draw a flow chart for printing Fibonacci series upto a term given by user.
d)     What is storage class in ‘C’? Explain different storage classes supported in C with suitable example.
e)      Write a program in ‘C’ to create a database of fifty students to store personal details such as Roll No., Name and Marks. Print all the details of student whose name is entered by user.

SECTION-C

3.      Attempt any two parts:                                                                       (5 X 2 = 10)
a)      Define number system. Why binary number system is used in computer?
b)      What is operating system? Explain main four functions of operating system.
c)      Define the following terms and give one example of each:
                                                              i.      Application Software
                                                            ii.      Symbolic Language
                                                          iii.      Data Error
                                                          iv.      Logical Error

4.      Attempt any two parts:                                                                       (5 X 2 = 10)
a)      Explain the different types of type conversion in ‘C’ with suitable example.
b)      Write a program in ‘C’ using conditional operator to find the largest among five numbers given by the user at run time.
c)      What is bitwise operator? Explain all bitwise operators in ‘C’ with suitable example.

5.      Attempt any two parts:                                                                       (5 X 2 = 10)
a)      Write a program in ‘C’ to print Pascal Triangle upto the rows given by user.
b)      Differentiate between break and continue with suitable example.
c)      Write a program in ‘C’ to convert a number in decimal system which is entered by the user to a number in hexadecimal system.

6.      Attempt any two parts:                                                                       (5 X 2 = 10)
a)      What is alternative to recursion? Write a program in ‘C’ to calculate the area and perimeter of a circle for a given radius using user defined single function which returns area and perimeter to the main function.
b)      Write a program in ‘C’ to read data from keyboard, write it to a file named PASCO, again read the same data from the file PASCO and display number of characters, number of vowels and number of lines contained in it on the screen.
c)      Write a program in ‘C’ to create a list of ten elements using dynamic memory allocation and display the sorted list.

7.      Attempt any two parts:                                                                       (5 X 2 = 10)
a)      Why C preprocessor is called preprocessor? Differentiate between statements
#include <facto.h> and
#include “facto.h”
Explain nested macros with suitable example.
b)      Write a program in ‘C’ to determine whether a string given by the user is palindrome or not without using strrev() function.
c)      Explain the architecture of LINUX operating system. Write any two file related and two directory related commands in LINUX with syntax.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.