Vous êtes sur la page 1sur 16

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: Epicsystems Inc Sample Programming Placement Paper Level1 (Bolded option is your answer) 1. Which of the following is the correct ways to set a value 3.14 in a variable pi such that it cannot be modified? A float pi = 3.14F; B #define pi 3.14F; C const float pi = 3.14F; D const float pi; pi = 3.14F;

2. Which of the following statement correctly assigns a value 33 to a variable c? byte a = 11, b = 22, c; A c = (byte) (a + B c = (byte) a b); + (byte) b;

C c = (int) a + (int) b; D c = (int)(a + b);

3. If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable? A. B& C* D -> 4. What does the following C#.NET code snippet will print? int i = 0, j = 0; label: i++; j+=i; if (i < 10) { Console.Write(i +" "); goto label; }
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 Prints 1 to 9

B Prints 0 to 8 C Prints 2 to 8

D Prints 2 to 9

5. What would be the equivalent pointer expression for referring the array element a[i][j][k][l] A ((((a+i)+j)+k)+l) B C (((a+i)+j)+k+l) D ((a+i)+j+k+l) *(*(*(*(a+i)+j) +k)+l) 6. The operator used to get value at address stored in a pointer variable is A* B& C && D ||

7. Which of the following statements is correct about the C#.NET program given below? namespace IndiabixConsoleApplication { class Baseclass { int i; public Baseclass(int ii) { i = ii; Console.Write("Base "); } } class Derived : Baseclass { public Derived(int ii) : base(ii) { Console.Write("Derived ");
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

} } class MyProgram { static void Main(string[ ] args) { Derived d = new Derived(10); } } } A The program B The C The program will will work program will report an error in correctly only if output: the statement we implement Derived Base base(ii). zero-argument constructors in Baseclass as well as Derived class. 8. What does the following declaration mean? int (*ptr)[10]; A ptr is array of pointers to 10 integers D The program will output: Base Derived

B ptr is a C ptr is an array of D ptr is an pointer to an 10 integers pointer to array of 10 array integers 9. For the code snippet shown below, which of the following statements are valid? public class Generic<T> { public T Field;
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

public void TestSub() { T i = Field + 1; } } class MyProgram { static void Main(string[] args) { Generic<int> gen = new Generic<int>(); gen.TestSub(); } } A Addition will B Result of C Program will produce result 1. addition is generate run-time systemexception. dependent.

D Compiler will report an error: Operator '+' is not defined for types T and int. 10. Which of the following statements is correct about the C#.NET program given below if a value "ABCD" is input to it? using System; namespace IndiabixConsoleApplication { class MyProgram { static void Main(string[] args) { int index;
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

int vat = 88; int[] a = new int(5]; try { Console.Write("Enter a number: "); index = Convert.Toint32(Console.ReadLine()); a[index] = val; } catch(Exception e) { Console.Write("Exception occurred"); } Console.Write("Remaining program"); } } } A It will output: Exception occurred C It will output: D It will Remaining program output: Exception occurred Exception occurred Remaining program 11. How will you print \n on the screen? A printf("\n"); B echo "\\n"; C printf('\n'); D printf("\\n"); B It will output: Remaining program

12. The library function used to find the last occurrence of a character in a string is A strnstr() B laststr() C strrchr() D strstr()

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

13. 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()

14. Which of the following function is more appropriate for reading in a multi-word string? A printf(); B scanf(); C gets(); D puts();

15. Which of the following statements should be added to the subroutine fun( ) if the C#.NET code snippet given below is to output 9 13? class BaseClass { protected int i = 13; } class Derived: BaseClass { int i = 9; public void fun() { // [*** Add statement here ***] } } A B C Console.WriteLin Console.Write Console.WriteLine( e(base.i + " " + i); Line(i + " " + mybase.i + " " + i); base.i);

D Console.Writ eLine(i + " " + mybase.i);

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

16. Which of the following statements is correct about the C#.NET program given below if a value "6" is input to it? using System; namespace IndiabixConsoleApplication { class MyProgram { static void Main (string[] args) { int index; int val = 66; int[] a = new int[5]; try { Consote.Write("Enter a number: "); index = Convert.ToInt32(Console.ReadLine()); a[index] = val; } catch(Exception e) { Console.Write("Exception occurred "); } Console.Write("Remaining program "); } } } A It will output: B It will C It will output: Exception output: Exception occurred occurred Remaining Remaining program program

D It will output: Remaining program

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

Exception occurred 17. In which stage the following code #include<stdio.h> gets replaced by the contents of the file stdio.h A During editing B During C During execution linking

D During preprocessin g 18. Which of the following is the correct order of evaluation for the below expression? z=x+y*z/4%2-1 A*/%+-= B=*/%+C/*%-+= D*%/-+= 19. Which of the following correctly shows the hierarchy of arithmetic operations in C? A/+*B*-/+ C+-/* D/*+-

20. 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 vary D None of from compiler to above compiler 21. 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)

22. Which of the following statements is correct about the C#.NET code snippet given below?
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

interface IPerson { String FirstName { get; set; } String LastName { get; set; } void Print(); void Stock(); int Fun(); } A Properties cannot be declared inside an interface.

D Subroutine in the interface must have a body. 23. Which of the following range is a valid long double (Turbo C in 16 bit DOS OS) ? A 3.4E-4932 to 1.1E+4932 B 3.4E-4932 to 3.4E+4932 C 1.1E-4932 to 1.1E+4932 D 1.7E-4932 to 1.7E+4932

B This is a perfectly workable interface.

C The properties in the interface must have a body.

24. Which of the following will be the correct output for the C#.NET program given below? namespace IndiabixConsoleApplication
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

{ class Sample { int i; Single j; public void SetData(int i, Single j) { this.i = i; this.j = j; } public void Display() { Console.WriteLine(i + " " + j); } } class MyProgram { static void Main(string[ ] args) { Sample s1 = new Sample(); s1.SetData(36, 5.4f); s1.Display(); } } } A 0 0.0 B 36 5.4 C 36 5.400000 D 36 5

25. Which of the following statements is correct about the C#.NET code snippet given below?
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

int i, j, id = 0; switch (id) { case i: Console.WriteLine("I am in Case i"); break; case j: Console.WriteLine("I am in Case j"); break; } A The compiler will report case i and case j as errors since variables cannot be used in cases. B Compiler C The code snippet D The code will report an prints the result as snippet prints error since "I am in Case i"". the result as there is no "I am in Case default case in j". the switch case statement. 26. We want to round off x, a float, to an int value, The correct way to do is A y = (int)(x + 0.5) B y = int(x + 0.5) C y = (int)x + 0.5 Dy= (int)((int)x + 0.5)

27. The binary equivalent of 5.375 is A 101.101110111 B 101.011 C 101011 D None of above

28. Which of the following statement obtains the remainder on dividing 5.5 by 1.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

A rem = (5.5 % 1.3)

B rem = C rem = fmod(5.5, modf(5.5, 1.3) 1.3)

D Error: we can't divide

29. What will you do to treat the constant 3.14 as a float? A use float(3.14f) B use 3.14f C use f(3.14) D use (f)(3.14)

30. A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored? A ABCD B DCBA C 0xABCD D Depends on big endian or little endian architecture 31. Which of the following is the correct output for the C#.NET code snippet given below? enum color { red, green, blue } color c; c = color.red; Console.WriteLine(c); A1 B -1

C red

D0

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

32. Which of the following will be the correct output for the C#.NET code snippet given below? enum color : int { red = -3, green, blue } Console.Write( (int) color.red + ", "); Console.Write( (int) color.green + ", "); Console.Write( (int) color.blue ); A -3, -2, -1 B -3, 0, 1 C 0, 1, 2

D red, green, blue

33. Which standard library function will you use to find the last occurance of a character in a string in C? A strnchar() B strchar() C strrchar() D strrchr()

34. What will the function randomize() do in Turbo C under DOS? A returns a random number. B returns a C returns a random D return a random number generator random number with a random number with generator in value based on a given seed the specified time. value. range. 35. Which of the following is correct about the C#.NET snippet given below? namespace IndiabixConsoleApplication
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

{ class Baseclass { public void fun() { Console.WriteLine("Hi" + " "); } public void fun(int i) { Console.Write("Hello" + " "); } } class Derived: Baseclass { public void fun() { Console.Write("Bye" + " "); } } class MyProgram { static void Main(string[ ] args) { Derived d; d = new Derived(); d.fun(); d.fun(77); } } }
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 The program gives the output as: Hi Hello Bye

B The C The program D Error in the program gives gives the output as: program the output as: Hi Bye Hello Bye Hello 36. What will be the size of the object created by the following C#.NET code snippet? namespace IndiabixConsoleApplication { class Baseclass { private int i; protected int j; public int k; } class Derived: Baseclass { private int x; protected int y; public int z; } class MyProgram { static void Main (string[ ] args) { Derived d = new Derived(); } } }

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 24 bytes

B 12 bytes

C 20 bytes

D 10 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

Vous aimerez peut-être aussi