WWW - Manaresults.Co - In: Computer Programming
WWW - Manaresults.Co - In: Computer Programming
1.(i) What is the output of the following code, Justify your answer.
int main()
{
int x=1, y=5;
printf(“%d”, ++x +y);
return 0;
}
(ii) What is the meaning of 3<j &&j<5? Is it equivalent to (3<j) && (j<5)?
(iii) What is the difference between iterative and recursive execution?
(iv) Write a function that checks whether a given year is leap year or not.
(v) Demonstrate the usage of ‘typedef’?
(vi) How is a file pointer declared?
[3+4+3+4+4+4]
PART- B
Page 1 of 2
WWW.MANARESULTS.CO.IN
||''|''||''||''''''|
Subject Code: R13205/R13 Set No - 1
Page 2 of 2
WWW.MANARESULTS.CO.IN
||''|''||''||''''''|
Subject Code: R13205/R13 Set No - 2
I B. Tech II Semester Regular Examinations August - 2014
COMPUTER PROGRAMMING
(Common to ECE, EEE, EIE, Bio-Tech, E Com.E, Agri. E)
Time: 3 hours Max. Marks: 70
Question Paper Consists of Part-A and Part-B
Answering the question in Part-A is Compulsory,
Three Questions should be answered from Part-B
*****
PART-A
2.(a) What is an integer constant, floating constant and character constant? Give valid examples.
(b) What are the different data type modifiers available in C language?
[8+8]
3.(a) Write conditional expressions to perform the following operations:
Given two numbers, calculate their sum if both numbers are either odd or even;
otherwise.
(b) Write a program segment using if statement to perform the following operation:
Given the coordinates centers of two circles and their radii, determine whether they
overlap or not.
[8+8]
4.(a) Explain in detail about self-referential structures with an example.
(b) Demonstrate the scope rules in blocks of a program.
[8+8]
5.(a) What is call by address? Consider the swap function for swapping two numbers and
illustrate how call by address is done?
(b) What is meant by dereferencing? How it is performed in ‘C’. [8+8]
6.(a) What is the main reason for using structure? What special keyword is used in defining a
structure? Give syntax for structure
(b) Demonstrate how one structure can be copied to another of the same type. [8+8]
Page 1 of 1
WWW.MANARESULTS.CO.IN
||''|''||''||''''''|
Subject Code: R13205/R13 Set No - 3
I B. Tech II Semester Regular Examinations August - 2014
COMPUTER PROGRAMMING
(Common to ECE, EEE, EIE, Bio-Tech, E Com.E, Agri. E)
Time: 3 hours Max. Marks: 70
Question Paper Consists of Part-A and Part-B
Answering the question in Part-A is Compulsory,
Three Questions should be answered from Part-B
*****
PART-A
1.(i) Write code to output the numbers from 1 to 10 using for loop.
(ii) Can we copy an array using the assignment operator? Justify your answer.
(iii)Write a function to exchange two numbers without using temporary variable.
(iv) What is the difference between malloc ( ) and calloc ( )?
(v) What is wrong with the following code:
struct {
char person_ name[20];
int num;
} name=” xyz”, 90;
(vi) What is meant by flushing of a file? [4+3+4+3+4+4]
PART- B
2.(a) Declare the variables and write the assignment statements to calculate the sum of squares
of the differences between each pair of three given numbers.
(b) Determine the sum and average of n numbers entered from keyboard. With a flowchart
represent the same.
[8+8]
3.(a) Give the control flow diagram of the for loop. How is the execution of ‘for’ loop
proceeds?
(b) Write a program to find the factorial of a given integer number using ‘while’ loop.
[8+8]
4.(a) Describe the call by value mechanism with examples.
(b) Write a function that uses a function to perform the addition of two matrices.
[8+8]
5.(a) Where is a pointer stored? What is a void pointer?
(b) Demonstrate the usage of character arrays with an example.
[8+8]
6.(a) Write a program using a pointer to structure illustrating the initialization of the members
in the structure.
(b) How are the members of a ‘Union’ are initialized and accessed? [8+8]
7.(a) What is stream? Describe two different methods of creating a stream oriented data file.
(b) How can the program detect that it has reached the end of the file?
(c) Explain about procedure and order of evaluation of operators in ‘C’. [5+5+6]
Page 1 of 1
WWW.MANARESULTS.CO.IN
||''|''||''||''''''|
Subject Code: R13205/R13 Set No - 4
1.(i) What are formatted input and output statements in C? Give suitable examples.
(ii) Comment on the size of pointer to different datatypes (int *, char *, float *).
(iii) Identify the error in the following function.
int small ( int a, int b )
{ int small=a;
if ( b < small ) small=b;
}
(iv) What is meant by flushing of a file?
(v) Difference between do-while and while-do constructs.
(vi) What is the use of rewind( ) function?
[4+4+4+3+4+3]
PART- B
2.(a) Draw a flowchart for printing the sum of even terms contained within 0 to 20.
(b) Write short notes on symbolic and high level languages.
[8+8]
3.(a) Describe about two dimensional array of strings, initializing the sized and unsized two
dimensional arrays and accessing elements in such arrays.
(b) Write a program to merge two sorted arrays into another array in a sorted order.
[8+8]
4.(a) What is a function and in what way does its use benefits a program?
(b) Write a program that uses a function to swap values stored in two integer variables to
understand the concept of local and global variables.
[6+10]
5.(a) How are variables passed to a function? Explain.
(b) When should be pointers used? What are the reasons?
[8+8]
6.(a) Define structure tag and explain what is its purpose?
(b) Write a program using a pointer to structure illustrating the initialization of the members
in the structure.
[8+8]
7.(a) Mention the different file opening modes that can be used with fopen ( ).
(b) Compare sequential versus random file access.
[8+8]
WWW.MANARESULTS.CO.IN Page 1 of 1
||''|''||''||''''''|