You are on page 1of 10

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.

com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

TITLE: L&T Infotech Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. What will be the output of the C#.NET code snippet given below? int num = 1, z = 5; if (!(num <= 0)) Console.WriteLine( ++num + z++ + " " + ++z ); else Console.WriteLine( --num + z-- + " " + --z ); A56 B65 C66 2. Declare the following statement? "An array of three pointers to chars". A char *ptr[3](); B char *ptr[3]; C char (*ptr[3])(); D char **ptr[3];

D77

3. The preprocessor directive # include is required if? A Console output is used B Console input C Both a and b is used D None of these

4. When a language has the capability to produce new data type, it is called? A Extensible B overloaded C Encapsulated D reprehensible

5. Declare the following statement? "A pointer to a function which receives nothing and returns nothing". A void *(ptr)*int; B void *(*ptr)() C void *(*ptr)(*) D void (*ptr)()

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

6. Which of the following .NET components can be used to remove unused references from the managed heap? A Common B CLR C Garbage D Class Loader Language Collector Infrastructure 7. Code that targets the Common Language Runtime is known as A Unmanaged B Distributed C Legacy D Managed Code

8. What will be the output of the C#.NET code snippet given below? byte b1 = 0xAB; byte b2 = 0x99; byte temp; temp = (byte)~b2; Console.Write(temp + " "); temp = (byte)(b1 << b2); Console.Write (temp + " "); temp = (byte) (b2 >> 2); Console.WriteLine(temp); A 102 1 38 B 108 0 32

C 102 0 38

D101

9. Which of the following is NOT a Bitwise operator in C#.NET? A& B| C << D^

10. Which of the following statements are correct about static functions?
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

A Static B Static C Static D Static functions are functions can functions are functions are invoked using access static outside the invoked using objects of a data as well as class scope. class. class. instance data. 11. What will be the output of the C#.NET code snippet given below? int i, j = 1, k; for (i = 0; i < 5; i++) { k = j++ + ++j; Console.Write(k + " "); } A 8 4 16 12 20 B 4 8 12 16 20

C 4 8 16 32 64

D 2 4 6 8 10

12. Which of the following statements is correct about properties used in C#.NET? A A property B A property C A write only D A write only can can be either property will property will simultaneously read only or have only get always return a be read only or write only. accessor. value. write only. 13. Which of the following statements is correct about properties used in C#.NET? A Every property must have a set accessor and a get accessor. B Properties cannot be overloaded. C Properties of a class are actually methods that work like data members. D A property has to be either read only or a write only.

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

14. What will be the output of the program? #include<stdio.h> int main() { const c = -11; const int d = 34; printf("%d, %d\n", c, d); return 0; } A Error B -11, 34

C 11, 34

D None of these

15. Which of the following keyword is used to overload user-defined types by defining static member functions? A op B opoverload C operator D operatoroverload

16. Which of the following modifier is used when a virtual method is redefined by a derived class? A overloads B override C overridable D virtual

17 What is x in the following program? #include<stdio.h> int main() { typedef char (*(*arrfptr[3])())[10]; arrfptr x;
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

return 0; } A x is a pointer B x is an array C x is an array D Error in x of three pointer of three declaration function pointers 18. Which of the following is the necessary condition for implementing delegates? A Class declaration B Inheritance C Run-time Polymorphism D Exceptions

19. Suppose on pushing a button an object is to be notified, but it is not known until runtime which object should be notified. Which of the following programming constructs should be used to implement this idea? A Attribute B Delegate C Namespace D Interface 20. What does fp point to in the program ? #include<stdio.h> int main() { FILE *fp; fp=fopen("trial", "r"); return 0; } A The first B A structure C The name of character in the which contains the file. file a char pointer which points to

D The last character in the file.

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

the first character of a file. 21. Which of the following CANNOT occur multiple number of times in a program? A namespace B Entrypoint C Class D Function

22. Which of the following is not a type of constructor? A Copy constructor B Friend constructor C Default constructor D Parameterized constructor

23. Consider the following program and what will be content of t? #include<stdio.h> int main() { FILE *fp; int t; fp = fopen("DUMMY.C", "w"); t = fileno(fp); printf("%d\n", t); return 0; } A size of B The handle C Garbage value D Error in fileno() "DUMMY.C" file associated with "DUMMY.C" file

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

24. Which of the following concepts provides facility of using object of one class inside another class? A Encapsulation B Abstraction C Composition D Inheritance

25. Which of the following is an abstract data type? A int B double C string D Class

26. Which of the following concepts means wrapping up of data and functions together? A Abstraction B Encapsulation C Inheritance D Polymorphism

27. Which of the following operator is overloaded for object cout? A >> B << C+ D=

28. Which of the following concepts is used to implement late binding? A Virtual function B Operator function C Const function D Static function

29. What will be the output of the program? #include<stdio.h> int main() { const int x=5; const int *ptrx;
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

ptrx = &x; *ptrx = 10; printf("%d\n", x); return 0; } A5 B 10 C Error D Garbage value

30. How can we make a class abstract? A By making all member functions constant. B By making at C By declaring it least one abstract using member the static function as keyword. pure virtual function. 31. Constructor is executed when _____. A an object is created B an object is used C a class is declared D By declaring it abstract using the virtual keyword.

D an object goes out of scope.

32. Which of the following means "The use of an object of one class in definition of another class"? A Encapsulation B Inheritance C Composition D Abstraction

33. Which of the following is the correct output for the C#.NET code snippet given below? enum color { red,
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

green, blue } color c; c = color.red; Console.WriteLine(c); A1 B -1

C red

D0

34. Which of the following statement will be correct if the function has three arguments passed to it? A The trailing B The first C The middle D All the argument will argument will argument will argument will be be the default be the default be the default the default argument. argument. argument. argument. 35. Which of the following function / type of function cannot be overloaded? A Member function B Static function C Virtual function D Both B and C

36. How many bytes will the structure variable samp occupy in memory if it is defined as shown below? class Trial { int i; Decimal d; } struct Sample { private int x; private Single y;
Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

private Trial z; } Sample samp = new Sample(); A 20 bytes B 12 bytes

C 8 bytes

D 16 bytes

Visit www.latestoffcampus.com for placement papers, interview tips & job updates. Toget freeupdates tomail https://groups.google.com/group/latestoffcampusLive updates on Facebook @ https://www.facebook.com/LatestOffCampus

You might also like