SAMPLE PAPER FOR PLACEMENT IN SASKEN TECHNOLOGIES
SAMPLE PAPER FOR PLACEMENT IN SASKEN TECHNOLOGIES
1. | What are the different types of real data type in C ? | ||||||||
Answer & ExplanationAnswer: Option C Explanation: The floating point data types are called real data types. Hence float, double, andlong double are real data types. | |||||||||
2. If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)? #include<stdio.h> #include<math.h> int main() { float a=5.375; char *p; int i; p = (char*)&a; for(i=0; i<=3; i++) printf(“%02x\n”, (unsigned char)p[i]); return 0; } | |||||||||
Answer: Option C |
3. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ? | ||||||||
Answer: Option C Explanation: fmod(x,y) – Calculates x modulo y, the remainder of x/y. Example:
#include <stdio.h> #include <math.h>
int main () { printf (“fmod of 5.5 by 1.3 is %lf\n”, fmod (5.5, 1.3) ); return 0; } Output: |
4. How many bytes are occupied by near, far and huge pointers (DOS)? | ||||||||||||||||||||||||||||||||||||||
Answer: Option A Explanation: near=2, far=4 and huge=4 pointers exist only under DOS. Under windows and Linux every pointers is 4 bytes long.
|
8. In which numbering system can the binary number 1011011111000101 be easily converted to? | ||||||||
Answer: Option B Explanation: Hexadecimal system is better, because each 4-digit binary represents one Hexadecimal digit. |
9. Which bitwise operator is suitable for turning off a particular bit in a number? | ||||||||||||||||||
Answer: Option B
|
11. Which of the following statements are correct about the program? #include<stdio.h>
int main() { unsigned int num; int i; scanf(“%u”, &num); for(i=0; i<16; i++) { printf(“%d”, (num<<i & 1<<15)?1:0); } return 0; } | ||||||||
Answer: Option C Explanation: If we give input 4, it will print 00000000 00000100 ; If we give input 3, it will print 00000000 00000011 ; If we give input 511, it will print 00000001 11111111 ; |
12. What will be the output of the program? #include<stdio.h> #include<stdlib.h>
int main() { int *p; p = (int *)malloc(20); /* Assume p has address of 1314 */ free(p); printf(“%u”, p); return 0; } | ||||||||
Answer: Option A |
13. Which of the following statement is correct prototype of the malloc() function in c ? | ||||||||
Answer: Option D |
14. Can I increase the size of statically allocated array? | ||||
Answer: Option B |
15. What will be the output of the program? #include<stdio.h>
int main() { int i; i = printf(“How r u\n”); i = printf(“%d\n”, i); printf(“%d\n”, i); return 0; } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
Answer: Option B Explanation: In the program, printf() returns the number of charecters printed on the console i = printf(“How r u\n”); This line prints “How r u” with a new line character and returns the length of string printed then assign it to variable i. i = printf(“%d\n”, i); In the previous step the value of i is 8. So it prints “8” with a new line character and returns the length of string printed then assign it tovariable i. So i = 2 (length of ‘\n’ is 1). printf(“%d\n”, i); In the previous step the value of i is 2. So it prints “2”.
|
« SOLUTION TO NTPC PLACEMENT PAPER Placement Paper of ISRO »
Tell us Your Queries, Suggestions and Feedback