MindTree Technical-Sample Paper-2011

September 2, 2017 | Author: Shayer Jaleel | Category: N/A
Share Embed Donate


Short Description

Download MindTree Technical-Sample Paper-2011...

Description

Assumptions 1. The generic function print() sends its arguments to the default output stream 2. The given blocks of code are a part of a class (Java, C++) and a file in C. 3. Print ( ) always prints with a new line.

Section 2: Technical 1) What will be the result of the following code? int i; for(i = 0; i 9); print(sum);

6) What will be the result of the following code? int a = 4, b = 0; if (a > 5) { b = 4; } else if (a < 10) { b = 3; } else if (a < 5) { b = 2; } else { b = 1; } print(b);

7) What will be the result of the following code? int i = 6720, j = 4; while((i % j) == 0) { i = i / j; j = j + 1; } print(j);

Copyright© 2010 HirePro Consulting Private Limited. All rights reserved. Page 2 of 4

8) What will be the return value on calling the function checksum(5)? int checksum(int n) { int c; if(n == 1) return(1); else c = n * checksum(n - 1); return(c); }

9) What will be the result of the following code? int i, x; for(i = 1; i > (2 + 1 - 2)) | (1 x) print("First"); else print("Second"); if (2 > x) print("Third"); print("Fourth"); print("Fifth");

12) What will be the result of the following code? int a = 1; while (a
View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF