July 6, 2021 in C and CPP
Develop a function to calculate sum of n even integers starting from a given even integer.
b) Develop a function to calculate sum of n even integers starting from a given even integer.
July 6, 2021 in C and CPP
b) Develop a function to calculate sum of n even integers starting from a given even integer.
July 6, 2021 in C and CPP
a) Write and explain the action of WHILE statement. Develop a program in ‘C’ language to
compute the average of every third integer number lying between 1 and 100. Include
appropriate documentation.
July 6, 2021 in C and CPP
a) Write a ‘C’ function to input from user appropriate values into matrices A and B. Use
suitable loops. Make use of pointers if necessary.
b) Write a ‘C’ function to calculate matrix C such that C=A+B Use suitable loops. Make use of pointers if necessary
c) Write a ‘C’ program to call the above two functions and print Matrix C suitably. Write suitable prototype etc. Use suitable loops. Make use of pointers if necessary
July 6, 2021 in C and CPP
c) Define a structure Time having integer data members hour, minute, second. Write a
program to enter two variables of the type Time and then add these two variables and store
the result into third variable. Also validate the second and minute of the result and print it.
July 6, 2021 in C and CPP
b) List out the rules to declare a valid variable in ‘C’ program. Evaluate the following expression and show the hierarchy of operations:
( 2 + 4 ) / 3 + 2%3 * 2 – 5
July 6, 2021 in C and CPP
a) Explain the concept of structured programming in detail.
July 6, 2021 in C and CPP
A. \b B. alloc.h C. 1 byte
D. stdio.h E. CPU Registers F. &&
G. fclose() H. 65 I. An Error
J. Array of characters K. \a L. &
M. ==
4.1 Logical AND operator is denoted by ________.
4.2 Size of char data type is ________.
4.3 The variables of storage class register are stored in ________.
4.4 If you try to multiply or add two pointers, it will result in ________.
4.5 In ‘C’, strings are stored in the form of ________.
4.6 Escape sequence for backspace is ________.
4.7 Function used to close a file is _________.
4.8 The header file which must be included, if you want to use malloc() or calloc() is
________.
4.9 The macro FILE is defined in header file ________.
4.10 The ASCII value, in decimal, of character ‘A’ is ________.
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 A structure can contain pointer to itself.
2.2 Size of all elements in a union should be same.
2.3 Size of a pointer is equal to the data type it points to.
2.4 In ‘C’, the compiler does not check if the subscript used for an array exceeds size of the array.
2.5 A ‘for’ loop in ‘C’ has three statements, namely, assignment, test and increment statements.
2.6 cout and cin can be used for output and input respectively in ‘C’ language.
2.7 The default initial value of a static int variable is zero.
2.8 Binary search can be easily performed on a linked list.
2.9 A function name can be passed as an argument to another function.
2.10 A ‘C’ function can contain many return statements.
July 6, 2021 in C and CPP
1.10 With every use of a memory allocation function, what function should be used to release
allocated memory which is no longer needed?
A) unalloc()
B) Dropmem()
C) Dealloc()
D) free()
July 6, 2021 in C and CPP
1.9 In the following ‘C’ code
{
FILE *f = fopen( fileName, "r");
fread(f);
if(????)
puts(“End of file reached”);
}
Which one of the following can replace the ???? in the code above to determine if the end of
a file has been reached?
A) f == EOF
B) feof( f )
C) eof( f )
D) f == NULL