Beruflich Dokumente
Kultur Dokumente
TITLE: Ebay Inc Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. What will be the output of the program? #include<stdio.h> #include<stdarg.h> void fun(char *msg, ...); int main() { fun(1, 4, 7, 11, 0); return 0; } void fun(char *msg, ...) { va_list ptr; int num; va_start(ptr, msg); num = va_arg(ptr, int); num = va_arg(ptr, int); printf("%d", num); } A 1 7 11 0 B1
C4
D7
2. In which stage the following code #include<stdio.h> gets replaced by the contents of the file stdio.h A During editing B During linking C During execution
D During preprocessing
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
3. What will the SWAP macro in the following program be expanded to on preprocessing? will the code compile? #include<stdio.h> #define SWAP(a, b, c)(c t; t=a, a=b, b=t) int main() { int x=10, y=20; SWAP(x, y, int); printf("%d %d\n", x, y); return 0; } A It compiles B Compiles with C Not compile an warning 4. Which of the following is not logical operator? A& B && C || D!
D none
5. In the following code, the P2 is Integer Pointer or Integer? typedef int *ptr; ptr p1, p2; A Integer B Integer C Error D None of above pointer 6. In the following code what is 'P'? typedef char *charp; const charp P; A P is a constant B P is a C P is character character type constant
D None of above
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
D 1, 2, 3
8. The keyword used to transfer control from a function back to the calling function is A switch B goto C go back D return
9. 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];
10. 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)()
11. Where the default value of parameter have to be specified? A Function call B Function definition C Function prototype D Both B or C
12. Which of the following function / types of function cannot have default parameters? A Member B main() function of class C Member function of structure D Both B and C
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. How many default constructors per class are possible? A Only one B Two C Three D Unlimited
16. A class's __________ is called when an object is destroyed. A constructor B destructor C assignment function Dcopy constructor
17. Constructor is executed when _____. A an object is created B an object is used C a class is declared D an object goes out of scope.
18. How many objects can be created from an abstract class? A Zero B One C Two D many
19. What does the class definitions in following code represent? class Bike {
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
B has a relationship
C Inheritance
D Both A and B
20. Which of the following can be overloaded? A Object B Functions C Operators D Both B and C
21. Which of the following is a mechanism of static polymorphism? A Operator overloading B Function overloading C Templates D All of the above
22. Which of the following is not a type of inheritance? A Multiple B Multilevel C Distributive D Hierarchical
23. Which of the following access specifier is used as a default in a class definition? A protected B public C private D friend
24. Which of the following should be used to implement a 'Has a' relationship between two entities? A Polymorphism B Templates C Containership D Encapsulation
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
25. Which of the following are reuse mechanisms available in C#.NET? 1.Inheritance 2.Encapsulation 3.Templates 4.Containership 5.Polymorphism A 1, 4 B 1, 3
C 2, 4
D 3, 5
26. Which of the following utilities can be used to compile managed assemblies into processor-specific native code? A gacutil B ngen C sn D dumpbin
27. 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 28. Code that targets the Common Language Runtime is known as A Unmanaged B Distributed C Legacy D Managed Code
29. Which of the following is the root of the .NET type hierarchy? A System.Object B System.Type C System.Base D System.Parent
30. Suppose n is a variable of the type Byte and we wish to put OFF its fourth bit (from right) without disturbing any other bits. Which of the following statements will do this correctly?
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 n = n && HF7
B n = n & 16
C n = n & 0xF7
D n = n & HexF7
31. What will be the output of the C#.NET code snippet given below? int a = 10, b = 20, c = 30; int res = a < b ? a < c ? c : a : b; Console.WriteLine(res); A 10 B 20
C 30
D error
32. Which four options describe the correct default values for array elements of the types indicated? 1.int -> 0 2.String -> "null" 3.Dog -> null 4.char -> '\u0000' 5.float -> 0.0f 6.boolean -> true A 1, 2, 3, 4 B 1, 3, 4, 5
C 2, 4, 5, 6
D 3, 4, 5, 6
33. Which is a reserved word in the Java programming language? A method B native C subclasses Dreference
34. Which three are legal array declarations? 1.int [] myScores []; 2.char [] myChars; 3.int [6] myScores;
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
35. What is the name of the method used to start a thread execution? A init(); B start(); C run(); D resume();
36. Which two of the following methods are defined in class Thread? 1.start() 2.wait() 3.notify() 4.run() 5.terminate() A 1 and 4
B 2 and 3
C 3 and 4
D 2 and 4
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