Mascot Previous Years Solved Sample Placement Papers
-
Which of the following statements are correct about an array?
1: The array int num[26]; can store 26 elements.
2: The expression num[1] designates the very first element in the array.
3: It is necessary to initialize the array at the time of declaration.
4: The declaration num[SIZE] is allowed if SIZE is a macro.
A: 1
B: 1,4
C: 2,3
D: 2,4
Ans: B -
Which of the following function is used to find the first occurrence of a given string in another string?
A: strchr()
B: strrchr()
C: strstr()
D: strnset()
Ans: C -
Which of the following function is correct that finds the length of a string?
Ans: A -
What will be the output of the program in 16-bit platform (Turbo C under DOS)?
A: 8, 1, 4
B: 4, 2, 8
C: 4, 2, 4
D: 10, 3, 4
Ans: B -
Which of the following statements are correct?
1: A string is a collection of characters terminated by '\0'.
2: The format specifier %s is used to print a string.
3: The length of the string can be obtained by strlen().
4: The pointer CANNOT work on string.
A: A, B
B: A, B, C
C: B, D
D: C, D
Ans: B -
Point out the error in the program?
A: Error: invalid structure member
B: Error: Floating point formats not linked
C: No error
D: None of above
Ans: B -
What is the similarity between a structure, union and enumeration?
A: All of them let you define new values
B: All of them let you define new data types
C: All of them let you define new pointers
D: All of them let you define new structures
Ans: B -
What will be the output of the program?
#include <stdio.h> int main() { enum days {MON=-1, TUE, WED=6, THU, FRI, SAT}; printf("%d, %d, %d, %d, %d, %d\n", MON, TUE, WED, THU, FRI, SAT); return 0; }
A: -1, 0, 1, 2, 3, 4
B: -1, 2, 6, 3, 4, 5
C: -1, 0, 6, 2, 3, 4
D: -1, 0, 6, 7, 8, 9
Ans: D -
What will be the output of the program?
A: 103 Dotnet
B: 102 Java
C: 103 PHP
D: 104 DotNet
Ans: A -
In which stage does the following code
#include <stdio.h>
get replaced by the contents of the file stdio.h?
A: During editing
B: During linking
C: During execution
D: During preprocessing
Ans: D -
Point out the error in the program
A: Error: unexpected end of file because there is no matching #endif
B: The number is odd
C: Garbage values
D: None of above
Ans: A -
What are the different types of real data types in C?
A: float, double
B: short int, double, long int
C: float, double, long double
D: double, long int, float
Ans: C