July 7, 2021 in C and CPP
What is dynamic memory allocation?
a) What is dynamic memory allocation? Mention four functions used for dynamic memory
manipulation.
July 7, 2021 in C and CPP
a) What is dynamic memory allocation? Mention four functions used for dynamic memory
manipulation.
July 7, 2021 in C and CPP
c) 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 7, 2021 in C and CPP
b) How Compilation, Linking and Loading are related? Also explain the basic task of a Compiler, Linker and Loader.
July 7, 2021 in C and CPP
a) Write a program using function to read an array from the user and print the odd number at odd position and prints the even numbers at even positions. For example input array is 1 2 3 4 and output is 2 1 4 3.
July 7, 2021 in C and CPP
c) Evaluate the following expressions, indicating which ones are true or false.
1. 10 = = 9 + 1
2. 10 && 8
3. 8 || 0
4. 0 && 0
5. Let X = 10 and Y=9;
X >= 8 && Y <= X
July 7, 2021 in C and CPP
b) What is union data type? Define a union ‘u’ to hold a integer, float and character variable.
July 7, 2021 in C and CPP
a) What is the significance of header file in a C Program? What do the header files usually
contain?
July 7, 2021 in C and CPP
b) Write a function to swap two integers. The function does not return any value.
July 7, 2021 in C and CPP
a) Write a Program to count lines, words and characters with a definition that a word is any sequence of characters that does not contain a blank, tab or new line.
July 7, 2021 in C and CPP
A. Multiply B. Register C. Gets()
D. ‘.’ E. ‘&’ F. Reference
G. ‘*’ H. Overflow I. Arbitrary
J. Goto K. value L. extern
M. Return
4.1 Many recursive calls may result into stack ________.
4.2 ________ is used to transfer control from a function back to the calling function.
4.3 The ________ operator is used to get value at address stored in a pointer variable.
4.4 ________ is more appropriate for reading in a multi-word string.
4.5 A Register variable is expected to be placed in machine ________.
4.6 The operator i << 2 is equivalent to ________ i by 4.
4.7 The ________ operator can be used access structure elements using a structure variable.
4.8 The function “lseek” provide a way to read or write a file in ________ order.
4.9 When a variable is passed to a function, by ________, its value remains unchanged in the calling program.
4.10 To share a variable across different files, ________ storage class is used.