Mascot Previous Years Solved Sample Placement Papers
-
What are the different types of real data type in C?
A. float, double
B. short int, double, long int
C. float, double, long double
D. double, long int, float
Ans: C -
Which statement will you add in the following program to work it correctly?
#include<stdio.h> int main() { printf("%f\n", lof(36.0)); return 0; }
A. #include<conio.h>
B. #include<math.h>
C. #include<stdlib.h>
D. #include<dos.h>
Ans: B -
What do the following declaration signify?
int *ptr[30];
A. ptr is a pointer to an array of 30 integer pointers.
B. ptr is an array of 30 pointers to integers.
C. ptr is an array of 30 integer pointers.
D. ptr is an array 30 pointers.
Ans: B -
What is x in the following program?
#include<stdio.h> int main() { typedef char (*(*arrfptr[3])())[10]; arrfptr x; return 0; }
A. x is a pointer
B. x is an array of three pointers
C. x is an array of three function pointers
-
You want to find out the value of the last element of an array. You write the following code. What will happen when you compile and run it?
public class MyAr{ public static void main(String argv[]){ int[] i = new int[5]; System.out.println(i[5]); } }
1) An error at compile time
2) An error at run time
3) The value 0 will be output
4) The string "null" will be output.
-
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
-
Write a program to remove duplicates from a sorted array.
-
In C, if you pass an array as an argument to a function, what actually gets passed?
A. Value of elements in array
B. First element of the array
C. Base address of the array
D. Address of the last element of array
Ans: C -
What will be the output of the program?
A. 2, 3, 4, 5
B. 1, 2, 3, 4
C. 0, 1, 2, 3
D. 3, 2, 1, 0
Ans: B -
What will be the output of the program if the array begins 1200 in memory?
A. 1200, 1202, 1204
B. 1200, 1200, 1200
C. 1200, 1204, 1208
D. 1200, 1202, 1200
Ans: B