Você está na página 1de 8

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: Interwoven Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. Which of the following operations can be performed on the file "NOTES.TXT" using the below code? FILE *fp; fp = fopen("NOTES.TXT", "r+"); A Reading B Writing

C Appending

D Read and Write

2. To print out a and b given below, which of the following printf() statement will you use? #include<stdio.h> float a=3.14; double b=3.14; A printf("%f %lf", a, b);

B printf("%Lf %f", a, b);

C printf("%Lf %Lf", a, b);

D printf("%f %Lf", a, b);

3. In which header file is the NULL macro defined? A stdio.h B stddef.h C stdio.h and stddef.h D math.h

4. What will be the output of the program? #include<stdio.h> int main() { int y=128; const int x=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

printf("%d\n", x); return 0; } A 128 B Garbage value C Error D0

5. How will you print \n on the screen? A printf("\n"); B echo "\\n"; C printf('\n'); D printf("\\n")

6. Which of the following function is used to find the first occurrence of a given string in another string? A strchr() B strrchr() C strstr() D strnset()

7. 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 8. How many times the program will print "IndiaBIX" ? #include<stdio.h> int main() { printf("IndiaBIX"); main(); return 0; }

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

A Infinite times

B 32767 times

C 65535 times

D Till stack overflows

9. Which of the following is the correct usage of conditional operators used in C? A a>b ? c=30 : c=40; B a>b ? c=30; C max = a>b ? a>c?a:c:b>c?b:c D return (a>b)?(a:b)

10. Which of the following is the correct order if calling functions in the below code? a = f1(23, 14) * f2(12/4) + f3(); A f1, f2, f3 B f3, f2, f1 C Order may D None of above vary from compiler to compiler 11. In which of the following a virtual call is resolved at the time of compilation? A From inside the destructor. B From inside C From inside the constructor. the main(). D Both A and B.

12. Which of the following statements regarding inline functions is correct? A It speeds up execution. B It slows down execution. C It increases the code size. D Both A and C.

13. Which of the following also known as an instance of a class? A Friend Functions B Object C Member Functions D Member Variables

14. Constructor is executed when _____.

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 an object is created

B an object is used

C a class is declared

D an object goes out of scope.

15. Which of the following can access private data members or member functions of a class? A Any function in the program. C Any member D Only public function of that member class. functions of that class. 16. How many objects can be created from an abstract class? A Zero B One C Two D As many as we want B All global functions in the program.

17. What does the class definitions in following code represent? class Bike { Engine objEng; }; class Engine { float CC; }; A kind of B has a relationship relationship

C Inheritance

D Both A and B

18. Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class? A Preprocessor B Linker C Loader D Compiler
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

19. A destructor takes __________ arguments. A one B two C three D no

20. Which of the following never requires any arguments? A Member function B Friend function C Default constructor D const function

21. Constructors __________ to allow different approaches of object construction. A cannot overloaded B can be overloaded C can be called D can be nested

22. Which of the following cannot be declared as virtual? A Constructor B Destructor C Data Members D Both A and C

23. Which of the following are NOT provided by the compiler by default? A ZeroB Destructor C Copy D Copy argument Constructor Destructor Constructor 24. Which of the following gets called when an object is being created? A constructor B virtual function C destructor D main

25. To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________
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 destructor

B delete

C delete[]

D kill[]

26. Which is a reserved word in the Java programming language? A method B native C subclasses D reference

27. Which is a valid keyword in java? A interface B string C Float D unsigned

28. Which is a valid declarations of a String? A String s1 = null; B String s2 = 'null'; C String s3 = (String) 'abc'; D String s4 = (String) '\ufeed';

29. Which is true about a method-local inner class? A It must be marked final. B It can be marked abstract. C It can be marked public. D It can be marked static

30. What is the prototype of the default constructor? A Test( ) B Test(void) C public Test( ) D public Test(void)

31. What is the narrowest valid returnType for methodA in line 3? public class ReturnIt { returnType methodA(byte x, double y) /* Line 3 */
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 (long)x / y * 2; } } A int B byte C long D double

32. Which one creates an instance of an array? A int[ ] ia = new B float fa = new int[15]; float[20]; D int ia[ ] [ ] = { 4, 5, 6 }, { 1,2,3 };D. 33. Which two of the following are legal declarations for nonnested classes and interfaces? 1.final abstract class Test {} 2.public static interface Test {} 3.final public class Test {} 4.protected abstract class Test {} 5.protected interface Test {} 6.abstract public class Test {} A 1 and 4 B 2 and 5 C char[ ] ca = "Some String";

C 3 and 6

D 4 and 6

34. Which of the following class level (nonlocal) variable declarations will not compile? A protected int a; B transient int b C private D volatile int d; = 3; synchronized int e; 35. Given a method in a protected class, what access modifier do you use to restrict access to that method to only the other members of the same class?
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 final

B static

C private

D protected

36. Which is a valid declaration within an interface? A public static short stop = 23; B protected short stop = 23; C transient short D final void stop = 23; madness(short stop);.

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

Você também pode gostar