Sie sind auf Seite 1von 13

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: Amazon Development Centre Sample programming Placement Paper Level1 (Bolded option is your answer) 1. Which of the following special symbol allowed in a variable name? A * (asterisk) B | (pipeline) C - (hyphen) D_ (underscore)

2. How would you round off a value from 1.66 to 2.0? A ceil(1.66) B floor(1.66) C roundup(1.66) D roundto(1.66)

3. Which of the following is not user defined data type? 1: struct book { char name[10]; float price; int pages; }; 2: long int l = 2.35; 3: enum day {Sun, Mon, Tue, Wed}; A1 B2 C3 D 1 and 2 4. Identify which of the following are declarations 1 : extern int x; 2 : float square ( float x ) { ... } 3 : double pow(double, double);
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

A1

B2

C 1 and 3

D3

5. When we mention the prototype of a function? A Defining B Declaring C Prototyping D Calling

6. What are the different types of real data type in C ? A float, double B short int, double, long int C float, double, long double D double, long int, float

7. What will you do to treat the constant 3.14 as a long double? A use 3.14LD B use 3.14L C use 3.14DL D use 3.14LF

8. If the binary eauivalent of 5.375 in normalised form is 0100 0000 1010 1100 0000 0000 0000 0000, what will be the output of the program (on intel machine)? #include<stdio.h> #include<math.h> int main() { float a=5.375; char *p; int i; p = (char*)&a; for(i=0; i<=3; i++) printf("%02x\n", (unsigned char)p[i]); return 0;
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 40 AC 00 00 B 04 CA 00 00 C 00 00 AC 40 D 00 00 CA 04

9. Which statement will you add in the following program to work it correctly? #include<stdio.h> int main() { printf("%f\n", log(36.0)); return 0; } A B C D #include<conio.h #include<math.h #include<stdlib.h #include<dos.h > > > > 10. We want to round off x, a float, to an int value, The correct way to do is A y = (int)(x + 0.5) Dy= (int)((int)x + 0.5) 11. Which of the following statement obtains the remainder on dividing 5.5 by 1.3 ? A rem = (5.5 % 1.3) B rem = modf(5.5, 1.3) C rem = fmod(5.5, 1.3) D Error: we can't divide B y = int(x + 0.5) C y = (int)x + 0.5

12. Which of the following keyword is used to overload an operator? A overload B operator C friend D override

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 is the root of the .NET type hierarchy? A System.Object B System.Type C System.Base D System.Parent

14. What will be the output of the C#.NET code snippet given below? byte b1 = 0xF7; byte b2 = 0xAB; byte temp; temp = (byte)(b1 & b2); Console.Write (temp + " "); temp = (byte)(b1^b2); Console.WriteLine(temp); A 163 92 B 92 163 C 192 63 D01 15. Which of the following is the correct output for the C#.NET code snippet given below? Console.WriteLine(13 / 2 + " " + 13 % 2); A 6.5 1 B 6.5 0 C60 D61 16. 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

D77

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

17. 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 18. 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

19. 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

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

20. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "ALL MEN ARE CREATED EQUAL"; String s2; s2 = s1.Substring(12, 3); Console.WriteLine(s2); A ARE B CRE C CR

D REA

21. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "Nagpur"; String s2; s2 = s1.Insert(6, "Mumbai"); Console.WriteLine(s2); A B Nagpur NagpuMumbair Mumbai

C NagpurMumbai

D Mumbai

22. Which of the following will be the correct output for the C#.NET code snippet given below? String s1="Kicit"; Console.Write(s1.IndexOf('c') + " "); Console.Write(s1.Length); A36 B25 C35

D26

23. Which of the following will be the correct output for the C#.NET code snippet given below? String s1 = "Five Star";
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

String s2 = "FIVE STAR"; int c; c = s1.CompareTo(s2); Console.WriteLine(c); A0 B1

C2

D -1

24. A derived class can stop virtual inheritance by declaring an override as A inherits B sealed C extends D inheritable

25. What will be the output of the following code snippet when it is executed? int x = 1; float y = 1.1f; short z = 1; Console.WriteLine((float) x + y * z - (x += (short) y)); A 0.1 B 1.0 C 1.1

D 11

26. 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);

27. 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 SampleProgram { static void Main(string[] args) { 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. What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[] args)
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[]arr = newint[]{ 1, 2, 3, 4, 5 }; fun(ref arr); } static void fun(ref int[] a) { for (int i = 0; i < a.Length; i++) { a[i] = a[i] * 5; Console.Write(a[ i ] + " "); } } } } A12345 B 6 7 8 9 10 C 5 10 15 20 25 D 5 25 125 625 3125

29. 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) { int a = 5; int s = 0, c = 0; Proc(a, ref s, ref c); Console.WriteLine(s + " " + 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

static void Proc(int x, ref int ss, ref int cc) { ss = x * x; cc = x * x * x; } } } A00 B 25 25 C 125 125 D 25 125

30. What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i = 10; double d = 34.340; fun(i); fun(d); } static void fun(double d) { Console.WriteLine(d + " "); } } } A 10.000000 B 10 34 C 10 34.340 34.340000

D 10 34.34

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

31. What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { object[] o = new object[] {"1", 4.0, "India", 'B'}; fun (o); } static void fun (params object[] obj) { for (int i = 0; i < obj.Length-1; i++) Console.Write(obj[i] + " "); } } } A 1 4.0 India B B 1 4.0 India C 1 4 India

D 1 India B

32. What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i; int res = fun(out 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

Console.WriteLine(res); } static int fun (out int i) { int s = 1; i = 7; for(int j = 1; j <= i; j++) { s = s * j; } return s; } } } A1 B7 C8 D 5040

33. What will be the output of the C#.NET code snippet given below? namespace IndiabixConsoleApplication { class SampleProgram { static void Main(string[ ] args) { int i = 5; int j; fun1(ref i); fun2(out j); Console.WriteLine(i + ", " + j); }
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

static void funl(ref int x) { x = x * x; } static void fun2(out int x) { x = 6; x = x * x; } } } A 5, 6 B 5, 36 C 25, 36 D 25, 0

34. Which class does not override the equals() and hashCode() methods, inheriting them directly from class Object? A java.lang.String B C D java.lang.Double java.lang.String java.lang.Chara Buffer cter 35. You need to store elements in a collection that guarantees that no duplicates are stored and all elements can be accessed in natural order. Which interface provides that capability? A java.util.Map B java.util.Set C java.util.List D java.util.Collec tion 36. Which interface does java.util.Hashtable implement? A Java.util.Map B Java.util.List C Java.util.HashTa ble D Java.util.Collec tion

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

Das könnte Ihnen auch gefallen