Company: Amazon Development Centre India

Amazon Placement paper

1. Two tables emp(empid,name,deptid,sal) and dept(deptid,deptname) are there.write a query which displays empname,corresponding deptname also display those employee names who donot belong to any dept.

2. Write prefix and post fix notation for (a+b)*c-(d+e)^(f-g)

3. write program to swap 2 variables without using extra memory.

4. Find the output for the following C program fn f(x)
{
if(x

A. 2, 3, 4, 5 B. 1, 2, 3, 4
C. 0, 1, 2, 3 D. 3, 2, 1 0
Ans-B

12. What will be the output of the program if the array begins 1200 in memory?

A. 1200, 1202, 1204 B. 1200, 1200, 1200
C. 1200, 1204, 1208 D. 1200, 1202, 1200
Ans-B

13. Which of the following statements are correct about an array?
1: The array int num[26]; can store 26 elements.
2: The expression num[1] designates the very first element in the array.
3: It is necessary to initialize the array at the time of declaration.
4: The declaration num[SIZE] is allowed if SIZE is a macro.

A. 1 B. 1,4
C. 2,3 D. 2,4
Ans-B

14. 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()
Ans-C

15. Which of the following function is correct that finds the length of a string?

Ans-A

16. What will be the output of the program in 16-bit platform (Turbo C under DOS) ?

A. 8, 1, 4 B. 4, 2, 8
C. 4, 2, 4 D. 10, 3, 4
Ans-B

17. Which of the following statements are correct ?
1: A string is a collection of characters terminated by ‘