July 6, 2021 in C and CPP
Write and explain the basic ‘C’ language construct used for structured programming.
c) Write and explain the basic ‘C’ language construct used for structured programming.
July 6, 2021 in C and CPP
c) Write and explain the basic ‘C’ language construct used for structured programming.
July 6, 2021 in C and CPP
b) List the various types of operators available in ‘C’. Write the hierarchical order of evaluation of
these.
July 6, 2021 in C and CPP
a) Differentiate between Union and Structure. Give one example of each.
July 6, 2021 in C and CPP
b) Develop an algorithm to remove duplicates from an ordered array of 10 elements. For example, if the input is 6, 7, 2, 7, 5, 1, 1, 5, 8, 2 then output should be 6, 7, 2, 5, 1, 8. Prepare a function program in ‘C’ for this algorithm.
July 6, 2021 in C and CPP
a) Write a program to generate a pyramid as shown below. The program should take the number
of rows as an input from the user.

July 6, 2021 in C and CPP
b) Write a program to sort the numbers 1, 6, -1, 2, 8, 5, 7, 6, 5, 4 in ascending order. Include appropriate documentation.
July 6, 2021 in C and CPP
a) Draw a flowchart and then write a program to add all the odd integers between 0 and 100.
July 6, 2021 in C and CPP
Each statement below has a blank space to fit one of the word(s) or phrase(s) in the list
below. Enter your choice in the “tear-off” answer sheet attached to the question paper,
following instructions therein.
A. stdin B. automatic C. int **a;
D. value E. int *p, *q; F. union
G. structure H. variable of a structure I. addition
J. constants K. reference L. int a[10, 20];
M. int *p, q; N. sparse O. variable of int type
P. pointer to a structure Q. multiplication R. stdout
S. static T. empty U. external
4.1 The statement int* p, q; is equivalent to ________.
4.2 More than one value can be returned by a function, if the arguments are passed to it by
________.
4.3 A(n) ________ matrix has a large number of zero entries and very few non-zero entries.
4.4 A two dimensional array of integers can also be defined as ________.
4.5 The fprintf function can be used to write on the screen if the first argument to it is ________.
4.6 If the request of register storage class is not honoured, then the variables are treated as having ________ storage class.
4.7 A ________ allows its members to share the same storage area in the computer memory.
4.8 The indirection operator is also used as ________ operator.
4.9 In t-> name, t is a(n) ________.
4.10 The incrementation operator cannot be applied to ________.
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 In a scanf statement, all the arguments after the control string must appear with address operator (&).
2.2 There must be atleast one #include statement in a C program.
2.3 The remainder operator cannot be applied to floating point numbers.
2.4 A function can be defined within another function.
2.5 The life of static variable is till the control remains within the block in which it is defined.
2.6 Given float a[10], *pa; The statement pa = ++a will initialize pa to &a[1].
2.7 If a function has an array as an argument, then changes done to the contents of the array are visible in the calling function also.
2.8 The number of bytes returned on using the sizeof operator with a structure may not be always
equal to the sum of the number of bytes occupied by the individual members of the structure.
2.9 The linked lists are non-linear homogeneous data structures.
2.10 A for loop can never be infinite.
July 6, 2021 in C and CPP
1.10 What is the following function determining?
int fn(int a, int b) {
if (b = = 0) return 0;
if (b = = 1) return a;
return a + fn(a, b-1);
}
A) a + b where a and b are integers
B) a + b where a and b are non-negative integers
C) a * b where a and b are integers
D) a * b where a and b are non-negative integers