Polaris Previous Years Solved Sample Placement Papers
-
Output of the following program is:
main() { int i = 0; for(i = 0; i < 20; i++) { switch(i) case 0: i += 5; case 1: i += 2; case 5: i += 5; default: i += 4; break; } printf("%d,", i); }
(a) 0,5,9,13,17
(b) 5,9,13,17
(c) 12,17,22
(d) 16,21 (Ans)
(e) Syntax error
-
What is the output of the following program:
main() { char c = -64; int i = -32; unsigned int u = -16; if(c > i) { printf("pass1,"); if(c) printf("pass2"); else printf("Fail2"); } else printf("Fail1"); if(i) printf("pass2"); else printf("Fail2"); }
(a) Pass1,Pass2
(b) Pass1,Fail2
(c) Fail1,Pass2 (Ans)
(d) Fail1,Fail2
(e) None of these
-
In the process table entry for the kernel process, the process ID value is:
(a) 0 (Ans)
(b) 1
(c) 2
(d) 255
(e) It does not have a process table entry
-
Which of the following API is used to hide a window?
(a) ShowWindow (Ans)
(b) EnableWindow
(c) MoveWindow
(d) SetWindowPlacement
(e) None of the above
-
What will the following program do?
void main() { int i; char a[] = "String"; char *p = "New String"; char *Temp; Temp = a; a = malloc(strlen(p) + 1); strcpy(a, p); // Line number: 9 p = malloc(strlen(Temp) + 1); strcpy(p, Temp); printf("(%s, %s)", a, p); free(p); free(a); } // Line number 15
(a) Swap contents of p & a and print: (New string, string)
(b) Generate compilation error in line number 8 (Ans)
(c) Generate compilation error in line number 5
(d) Generate compilation error in line number 7
(e) Generate compilation error in line number 1
-
A, B, and C have some marbles with each of them. A gives B and C the same number of marbles as each already has. Then, B gives C and A the same number of marbles they already have. Finally, C gives A and B the same number of marbles they already have. At the end, A, B, and C have an equal number of marbles.
-
If x, y, z are the marbles initially with A, B, and C, respectively, then the number of marbles B has at the end:
(a) 2(x-y-z)
(b) 4(x-y-z)
(c) 2(3y-x-z) (Ans)
(d) x + y - z
-
If the total number of marbles is 72, then the number of marbles A initially had:
(a) 20
(b) 30
(c) 32
(d) 39 (Ans)
-
If x, y, z are the marbles initially with A, B, and C, respectively, then the number of marbles B has at the end:
-
A car starts from A towards B with some velocity. Due to an engine problem after traveling 30 km, the car goes with 4/5th of its actual velocity. The car reaches B 45 minutes later than the actual time. If the car engine fails after traveling 45 km, the car reaches B 36 minutes late. What is the initial velocity of the car, and what is the distance between A and B in km?
Ans: 20 & 130
-
A person has Rs 100/- in his pocket. He can buy 25 pencils or 15 books. He kept 15% of the money for traveling expenses and purchased 5 pencils. How many books can he purchase with the remaining money?
Ans: 4 books
-
Ten questions on analogies:
- chief : tribe :: governor : state
- epaulette : shoulder :: tiara : head
- guttural : throat :: gastric : stomach
- inept : clever :: languid : active
- knife : butcher :: hammer : carpenter
-
The values of shares (in Rs) of A, B, and C from January to June are as follows:
Month A B C January 30 60 80 February 35 65 85 March 45 75 65 April 40 75 82 May 55 75 85 June 50 75 80
- During this period, which share has undergone maximum fluctuation?
Ans: Share C
- In which month is it possible to buy B and C by selling A?
Ans: March
- In which month are the share values very low?
Ans: January
- By purchasing one share of A and four each of B and C in the beginning of the period, when should these be sold to get the maximum profit?
Ans: May
- During this period, which share has undergone maximum fluctuation?