BTECH FIRST YEAR EXAMINATION JUNE 2008 (for new scheme)
COMPUTER PROGRAMMING Max marks:100
Time:3 Hrs
PART A
1. a) List out 5 rules for naming variables.
b) Give the syntax of scanf statement & list out any 4 format specifiers.
c) List out any 5 system defined/Library functions.
d) Define actual & formal parameters, with eg.What are the 3 rules to be followed
related to these arguments when a function call is made.
e) Give syntax of a structure. When do we use structures? Give eg. What are the
methods to create structure variables?
f) Declare a 1-Dimensional (1-D) array of size 100, to store integers. If the starting
location of the array is 3000, what is the address of the 13th element? Give a
generalized formula.
g) What are pointers? Explain with eg. How is the pointers linked with arrays?
h) Write short notes on : 1) type def 2) enum
PART B
2. List out 4 categories of operators in C, with the list of 5 operators in each category.
Give the order of evaluation of the operators in tabular format.
OR
3. Write a C program to find the prime no.s between 1 & 100.(Give logic & eg)
4. a) Write a C program to find sum of integers 1,2,……..,n using recursion.(give
logic & eg)
b) List the scope, visibility, storage area, intial value & life time of register & auto
storage class in tabular format.
OR
5. a) Explain 1) Parameter passing by value 2) Parameter passing by reference.
b) Write a function “Large” in C to find the largest of n numbers, which receives an
array of no.s & number of numbers as parameters.
6. a) Write C program to do selection sort such that if no swapping happens in a pass,
sorting stops.
b) Write C program to initialize the upper triangular elements of a matrix with zero.
c) Why is union used? Give syntax.
OR
7. a) Write a C program using structures to store student details like roll no., name, class,
sex, mark1, mark2, & total. The total mark is the sum of mark1 & mark2 & is
evaluated automatically. Search for those ‘girl’ students who have total> 75, assume
mark1 & mark2 are in 50.(give logic & eg)
8. a) Write a C program using command line arguments, to concatenate two strings
“HELLO” & “WORLD” given at command line.
b) How does the execution of programs involving command line arguments differ from
other programs?
c) Explain what is the function of # include directive.
OR
9. a) What are pointers to structures? Explain with eg.
b) Explain any 2 preprocessor directive.
c) What are pointers to functions, explain with eg?
---------------------------------
No comments:
Post a Comment