Você está na página 1de 10

Visit www.latestoffcampus.

com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

TITLE: TCS Sample Programming Placement Paper Level-I (Bolded option is your answer) 1. How many times the program will print "IndiaBIX" ? #include<stdio.h> int main() { printf("IndiaBIX"); main(); return 0; } A Infinite times B 32767 times

C 65535 times

D Till stack overflows

2. Which of the following statements should be used to obtain a remainder after dividing 3.14 by 2.1 ? A rem = 3.14 % B rem = modf(3.14, C rem = D Remainder cannot be 2.1; 2.1); fmod(3.14, 2.1); obtain in floating point division. 3. Is there any difference between following declarations? 1 : extern int fun(); 2 : int fun(); A No difference, B Both are identical C int fun(); is D None of these except extern overrided with int fun(); is extern int fun(); probably in another file 4. How would you round off a value from 1.66 to 2.0? A floor(1.66) B ceil(1.66) C roundup(1.66) D roundup(1.66)

Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

5. Can you combine the following two statements into one? char *p; p = (char*) malloc(100); A char *p = (char B char *p = C char *p = D char p = *malloc(100); *)(malloc*)(100); (char*)malloc(100); (char) malloc(100); 6. How many bytes are occupied by near, far and huge pointers (DOS)? A near=2 far=4 B near=4 far=8 C near=2 far=4 D near=4 far=4 huge=8 huge=4 huge=8 huge=8 7. Which of the following function sets first n characters of a string to a given character? A strcset() B strset() C strnset() D strinit() 8. What will the function rewind() do? A Reposition the B Reposition the C Reposition the D Reposition the file file pointer to a file pointer stream file pointer to pointer to begining of file. character to end of file. begining of that reverse. line. 9. How will you free the memory allocated by the following program? #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() { int **p, i, j; p = (int **) malloc(MAXROW * sizeof(int*)); return 0;}
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

A memfree(int B dealloc(p); C malloc(p, 0); D free(p); p); 10. Which of the following type of class allows only one object of it to be created? A Virtual class C Singleton D Friend class class 11. What happens when we try to compile the class definition in following code snippet? class Birds {}; class Peacock : protected Birds {}; A It will not B It will not compile compile because because class body class body of of Eagle is not Birds is not defined. defined. B Abstract class

C It will not D It will compile compile succesfully. because a class cannot be protectedly inherited from other class. 12. Which of the following function prototype is perfectly acceptable? A int B float Function(int C Both A and B. D float = Show(int, float) Function(int Tmp = Show(int, Function(Tmp); Tmp = Show()); float)); 13. What happens when a class with parameterized constructors and having no default constructor is used in a program and we create an object that needs a zero zeroargument constructor? A Compile-time B Preprocessing C Runtime D Runtime exception. error. error. error. 14. Which of the following statements is correct? 1.Once a reference variable has been defined to refer to a particular variable it can Once refer to any other variable. 2.A reference is not a constant pointer.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

A Only 1 is B Only 2 is correct. C Both 1 and 2 D Both 1 and 2 are correct. are correct. incorrect. 15. Functions can be declared to return a reference type. There are reasons to make such a declaration/Which of the following reasons are correct? 1.The information being returned is a large enough object that returning a reference The is more efficient than returning a copy. 2.The type of the function must be a R-value. A Only 1 is B Only 2 is correct. C Both 1 and 2 D Both 1 and 2 are correct. are correct. incorrect. 16. For automatic objects, constructors and destructors are called each time the objects A enter and B inherit parent C are D are destroyed leave scope class constructed 17. Which of the following statement is correct about the references? A A reference B A reference must C A reference D Both A and C. must always be always be must always be initialized within initialized outside initialized. functions. all functions. 18. Which of the following concepts means determining at runtime what method to invoke? A Data hiding B Dynamic Typing C Dynamic D Dynamic loading binding 19. Which of the following statements are TRUE about the .NET CLR? It provides a language-neutral development & execution environment. It ensures that an application would not be able to access memory that it is not authorized to access. It provides services to run "managed" applications. The resources are garbage collected. It provides services to run "unmanaged" applications. A Only 1 and 2 B Only 1, 2 and 4 C 1, 2, 3, 4 D Only 4 and 5
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

20. Which of the following are the correct ways to increment the value of variable a by 1? ++a++; a += 1; a ++ 1; a = a +1; a = +1; A 1, 3

B 2, 4

C 3, 5

D 4, 5

21. Which of the following statements is correct? A A constructor B C# provides a C Destructors D A class can have more can be used to copy constructor. are used with than one destruc destructor. set default classes as well values and limit as structures. instantiation. 22. Which of the following statements are true about the C#.NET code snippet given #.NET below? String s1, s2; s1 = "Hi"; s2 = "Hi"; 1.String objects cannot be created without using new. 2.Only one object will get created. 3.s1 and s2 both will refer to the same object. 4.Two objects will get created, one pointed to by s1 and another pointed to by s2. 5.s1 and s2 are references to the same object. A 1, 2, 4 B 2, 3, 5 C 3, 4 D 2, 5 23. Which of the following statements is correct about properties used in C#.NET? A A property can B A property can C A write only simultaneously be either read only property will D A write only property will always return a value.

Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

be read only or or write only. have only get write only. accessor. 24. Which of the following unary operators can be overloaded? 1.true 2.false 3.+ 4.new 5.is A 1, 2, 3

B 3, 4, 5

C 3 only

D 5 only

25. Which of the following statements is incorrect about delegate? A Delegates are B Delegates are C Delegates are D Only one method can be called using a delegate. reference types. object oriented. type-safe. 26. Which of the following statements are correct about data types? 1.If the integer literal exceeds the range of byte, a compilation error will occur. 2.We cannot implicitly convert non-literal numeric types of larger storage size to literal byte. 3.Byte cannot be implicitly converted to float. 4.A char can be implicitly converted to only int data type. 5.We can cast the integral character codes. A 1, 3, 5 B 2, 4 C 3, 5 D 1, 2, 5 27. Which of the following will be the correct output for the C#.NET program given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[] args)
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

{ int num = 1; funcv(num); Console.Write(num + ", "); funcr(ref num); Console.Write(num + ", "); } static void funcv(int num) { num = num + 10; Console.Write(num + ", "); } static void funcr (ref int num) { num = num + 10; Console.Write(num + ", "); } } } A 1, 1, 1, 1, B 11, 1, 11, 11, C 11, 11, 11, 11, D 11, 11, 21, 11,

28. Which of the following can be facilitated by the Inheritance mechanism? d Use the existing functionality of base class. Overrride the existing functionality of base class. Implement new functionality in the derived class. Implement polymorphic behaviour. Implement containership. A 1, 2, 3 B 3, 4 C 2, 4, 5 D 3, 5 29. Which four options describe the correct default values for array elements of the types indicated? int -> 0 String -> "null" Dog -> null
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

char -> '\u0000' float -> 0.0f boolean -> true A 1, 2, 3, 4

B 1, 3, 4, 5

C 2, 4, 5, 6

D 3, 4, 5, 6

30. public void foo( boolean a, boolean b) { if( a ) { System.out.println("A"); /* Line 5 */ } else if(a && b) /* Line 7 */ { System.out.println( "A && B"); } else /* Line 11 */ { if ( !b ) { System.out.println( "notB") ; } else { System.out.println( "ELSE" ) ; } } } A If a is true and B If a is true and b C If a is false D If a is false and b is false b is true then is false then the and b is false then the output is "ELSE" the output is "A output is "notB" then the output && B" is "ELSE" 31. Which is true about an anonymous inner class?
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

A It can extend exactly one class and implement exactly one interface.

C It can extend exactly one class or implement exactly one interface. 32. What will be the output of the program?

B It can extend exactly one class and can implement multiple interfaces.

D It can implement multiple interfaces regardless of whether it also extends a class.

public class Foo { public static void main(String[] args) { try { return; } finally { System.out.println( "Finally" ); } } } A Finally B Compilation fails. C The code runs D An exception is thrown at with no output. runtime. 33. What is the name of the method used to start a thread execution? A init(); B start(); C run(); D resume();

34. What is the value of "d" after this line of code has been executed? double d = Math.round ( 2.5 + Math.random( )); A2 B 2.5 C4

D 2.5

Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com For More Placement Papers, Interview tips , Job Updates To Get 24*7 Updates Via Facebook Like Us @ http://www.facebook.com/LatestOffCampus
To Get Free Job Updates To Your mail Join US @ http://groups.google.com/group/latestoffcampus/subscribe

35. What will be the output of the program? class PassA { public static void main(String [] args) { PassA p = new PassA(); p.start(); } void start() { long [] a1 = {3,4,5}; long [] a2 = fix(a1); System.out.print(a1[0] + a1[1] + a1[2] + " "); System.out.println(a2[0] + a2[1] + a2[2]); } long [] fix(long [] a3) { a3[1] = 7; return a3; } } A 12 15 B 15 15 C345375 D375375

36. Suppose that you would like to create an instance of a new Map that has an iteration order that is the same as the iteration order of an existing instance of a Map. Which concrete implementation of the Map interface should be used for the new instance? A TreeMap B HashMap C D The answer depends on LinkedHashMap the implementation of the existing instance instance.
Visit www.latestoffcampus.com for placement papers, interview tips & job updates To get updates. free updates to mail https://groups.google.com/group/latestoffcampus Live updates on Facebook @ https://www.facebook.com/LatestOffCampus

Você também pode gostar