July 6, 2021 in C and CPP
Describe the two ways of passing parameters to function
b) Describe the two ways of passing parameters to function. Also differentiate them with an
example.
July 6, 2021 in C and CPP
b) Describe the two ways of passing parameters to function. Also differentiate them with an
example.
July 6, 2021 in C and CPP
a) Explain the basic structure of C program with a neat block diagram. Also explain the steps to execute a C program.
July 6, 2021 in C and CPP
b) A library charges a fine for every book returned late. For first 5 days the fine is 50 paisa, for 6-10 days, fine is one rupee and above 10 days, fine is 5 rupees. If you return the book after 30 days your membership will be cancelled. Write a program to accept the number of days the member is late to return the book and display the fine or the appropriate message.
July 6, 2021 in C and CPP
a) A five digit number is entered through the keyboard. Write a program to obtain the number with the digits reversed and to determine whether the original and reversed numbers are equal or not.
July 6, 2021 in C and CPP
A. goto B. int C. void
D. Union E. less F. size_of
G. EOF H. 32767 I. n-1
J. structure K. puts L. 35665
M. n+1
4.1 The maximum value that an integer constant can have is ________ for 16 bit integers.
4.2 The function getchar() returns ________ when there is no more input character.
4.3 The ________ operator returns the number of bytes the operand occupies.
4.4 An array declared as int a[5][5][5]; if the address of the element a[1][4][1] is x, then the address of the element a[1][2][1] is ________ than x.
4.5 The ________ requires a label in order to identify the place where the branch is to be made.
4.6 In an exit-controlled loop, if the body is executed n times, the test condition is evaluated ________ times.
4.7 A pointer can be cast to ________ pointer without loss of information.
4.8 The printf may be replaced by ________ function for printing strings.
4.9 By default, ________ is the return type of a C function.
4.10 A ________ is a collection of data items under one name in which the items share the same storage.
July 6, 2021 in C and CPP
Each statement below is either TRUE or FALSE. Choose the most appropriate one and
ENTER in the “tear-off” sheet attached to the question paper, following instructions
therein.
2.1 C Programs are converted into machine language with the help of an operating system.
2.2 The real constant in C can be expressed in both fractional and exponential forms.
2.3 To return the control back to the calling function the keyword return must be used.
2.4 All automatic variables become static when a function is recursive.
2.5 If the variable x is defined outside all functions and a variable x is also defined as a local variable of some function, then the global variable gets preference over the local variable.
2.6 Address of a floating point variable is always a whole number.
2.7 In an array of structures, not only are all structures stored in contiguous memory locations, but the elements of individual structures are also stored in contiguous locations.
2.8 If a file is opened for reading, it is necessary that the file must exist.
2.9 An expression contains relational operators, assignment operators, and arithmetic operators. In the absence of parentheses, they will be evaluated in arithmetic, relational and assignment operators.
2.10 If the statements within the loop must be executed only once then a do – while loop is useful.
July 6, 2021 in C and CPP
1.10 Which of the following is the correct way of declaring a float pointer?
A) float ptr;
B) float *ptr;
C) *float ptr;
D) none of the above
July 6, 2021 in C and CPP
1.9 The break statement causes an exit
A) only from the innermost loop
B) only from the outermost loop
C) from all loops and switches
D) from the innermost loop and switch
July 6, 2021 in C and CPP
1.8 When an array as an argument to a function is passed, what actually gets passed?
A) address of the array
B) values of the elements of the array
C) address of the first element of the array
D) number of elements of the array
July 6, 2021 in C and CPP
1.7 What will be the output of the following program?
void main ( )
{
int count = 5;
while (count)
printf(“%d”, count--);
}
A) 5 5 5 5 5
B) 5
C) 5 4 3 2 1
D) 0 0 0 0 0