### DESHAW CAMPUS PLACEMENT PAPER ( TECHNICAL- C)

PAPER: DESHAW CAMPUS PLACEMENT PAPER ( TECHNICAL- C)

SECTION-A

Write the programs for the following problems in C.

1. Swap two variables x,y without using a temporary variable.

2. Write algorithm for finding the GCD of a number.

3.Write a program for reversing the given string.

4. The integers from 1 to n are stored in an array in a random fashion. but one integer is missing. Write a program to find the missing integer.

Ans. Hint : The sum of n natural numbers is = n(n+1)/2. if we subtract the above sum from the sum of all the numbers in the array , the result is nothing but the

missing number.

5. Some bit type of questions has been given on pointers asking to to find whether it is correct from syntax point of view. and if it is correct explain what it will do. (around 15 bits).

SECTION-B

6. For the following C program

#define AND &&

#define ARRANGE (a>25 AND a<50)

main()

{int a = 30;

if (ARRANGE)

printf("within range");

else

printf("out of range");

}

What is the output?

7. For the following C program

#define AREA(x)(3.14*x*x)

main()

{floatr1=6.25,r2=2.5,a;

a=AREA(r1);

printf("

Area of the circle is %f", a);

a=AREA(r2);

printf("

Area of the circle is %f", a);

}

What is the output?

Ans. Area of the circle is 122.656250

Area of the circle is 19.625000

8. What do the following statements indicate. Explain.

int(*p)[10]

int*f()

int(*pf)()

int*p[10]

Refer to:

-- Kernighan & Ritchie page no. 122

-- Schaum series page no. 323

9. Write a C program to find whether a stack is progressing in forward or reverse direction.

10. Write a C program that reverses the linked list.

### Companies List:

3i Infotech - AAI - ABACUS - ABB - Accel Frontline - Accenture - Aditi - Adobe - ADP - Agreeya - Akamai - Alcatel Lucent - Allfon - Alumnus - Amazon - Amdocs - AMI - Andhra Bank - AppLabs - Apps Associates - Aricent - Ashok Leyland - Aspire - Atos Origin - Axes - Bajaj - Bank of Maharashtra - BEL - BEML - BHEL - BirlaSoft - Blue Dart - Blue Star - BOB - BPCL - BPL - Brakes - BSNL - C-DOT - Cadence - Calsoft - Canara Bank - Canarys - Capgemini - Caritor - Caterpillar - CDAC - CGI - Changepond - Ciena - Cisco - Citicorp - CMC - Consagous - Convergys - CORDYS - Crompton - CSC - CTS - Cummins - Dell - Deloitte - Delphi-TVS - DeShaw - Deutsche - Dotcom - DRDO - EDS - EIL - ELGI - ELICO - ERICSSON - Essar - Fidelity - Flextronics - Freescale - FXLabs - GAIL - GE - Genpact - Geodesic - Geometric - Globaledge - GlobalLogic - Godrej - Google - Grapecity - HAL - HCL - Hexaware - Honeywell - HP - HPCL - HSBC - Huawei - Hughes - IBM - IBS - ICICI - iGate - Impetus - iNautix - Indian Airforce - Indian Airlines - Infosys - Infotech - Intec - Integra - Intergraph - IOCL - iSOFT - ISRO - Ittiam - JSW - Keane - Kenexa - L & T - L & T Infotech - LG Soft - Lifetree - LionBridge - Mahindra Satyam - Mastek - Maveric - McAfee - MECON - Microsoft - MindTree - Miraclesoft - Mistral - Motorola - Mphasis - MTNL - NIC - Nokia Siemens - Novell - NTPC - Nucleus - ORACLE - Patni - Perot - Polaris - Ramco - Robert Bosch - Samsung - SAP - Sapient - Sasken - SBI - Sierra Atlantic - Sonata - Sony India - Sutherland - Syntel - TCS - Tech Mahindra - VeriFone - Virtusa - Wipro - Zensar.