Citicorp Placement Paper (Technical Section)

 

Technical Paper

 

1. The following variable is available in file1.c static int average_float; all the functions in the file1.c can access the variable

 

2. extern int x;

 

3. Another Problem with

 

# define TRUE 0

 

some code

 

while(TRUE)

 

{

 

some code

 

}

 

This won't go into the loop as TRUE is defined as 0

 

4. A question in structures where the members are dd,mm,yy.

 

mm:dd:yy

 

09:07:97

 

5. Another structure question

 

6. INFILE.DAT is copied to OUTFILE.DAT

 

7. A question with argc and argv . Input will be c:\TEMP.EXE Ramco Systems India

 

8..main()

 

{

 

int x=10,y=15;

 

x=x++;

 

y=++y;

 

printf("%d %d\n",x,y);

 

}

 

9.int x;

 

main()

 

{

 

int x=0;

 

{

 

int x=10;

 

x++;

 

change_value(x);

 

x++;

 

Modify_value();

 

printf("First output: %d\n",x);

 

}

 

x++;

 

change_value(x);

 

printf("Second Output : %d\n",x);

 

Modify_value();

 

printf("Third Output : %d\n",x);

 

}

 

Modify_value()

 

{

 

return (x+=10);

 

}

 

change_value()

 

{

 

return(x+=1);

 

}

 

10.main()

 

{

 

int x=20,y=35;

 

x = y++ + x++;

 

y = ++y + ++x;

 

printf("%d %d\n",x,y);

 

}

 

11.main()

 

{

 

char *p1="Name";

 

char *p2;

 

p2=(char *)malloc(20);

 

while(*p2++=*p1++);

 

printf("%s\n",p2);

 

}

 

12.main()

 

{

 

int x=5;

 

printf("%d %d %d\n",x,x<<2,x>>2);

 

}

 

13.#define swap1(a,b) a=a+b;b=a-b;a=a-b;

 

main()

 

{

 

int x=5,y=10;

 

swap1(x,y);

 

printf("%d %d\n",x,y);

 

swap2(x,y);

 

printf("%d %d\n",x,y);

 

}

 

int swap2(int a,int b)

 

{

 

int temp;

 

temp=a;

 

b=a;

 

a=temp;

 

return;

 

}

 

14.main()

 

{

 

char *ptr = "Ramco Systems";

 

(*ptr)++;

 

printf("%s\n",ptr);

 

ptr++;

 

printf("%s\n",ptr);

 

}

 

15.#include<stdio.h>

 

main()

 

{

 

char s1[]="Ramco";

 

char s2[]="Systems";

 

s1=s2;

 

printf("%s",s1);

 

}

 

16.#include<stdio.h>

 

main()

 

{

 

char *p1;

 

char *p2;

 

p1=(char *) malloc(25);

 

p2=(char *) malloc(25);

 

strcpy(p1,"Ramco");

 

strcpy(p2,"Systems");

 

strcat(p1,p2);

 

printf("%s",p1);

 

}

Citicorp Placement Paper (Technical-C)

 

C questions

 

1. main()

{

int x=10,y=15;

x=x++;

y=++y;

printf("%d %d\n",x,y);

}

 

2. int x;

main()

{

int x=0;

{

int x=10;

x++;

change_value(x);

x++;

Modify_value();

printf("First output: %d\n",x);

}

x++;

change_value(x);

printf("Second Output : %d\n",x);

Modify_value();

printf("Third Output : %d\n",x);

}

 

Modify_value()

{

return (x+=10);

 

 

 

}

 

change_value()

{

return(x+=1);

}

 

3. main()

{

int x=20,y=35;

x = y++ + x++;

y = ++y + ++x;

printf("%d %d\n",x,y);

}

 

4. main()

{

char *p1="Name";

char *p2;

p2=(char *)malloc(20);

while(*p2++=*p1++);

printf("%s\n",p2);

}

 

5. main()

{

int x=5;

printf("%d %d %d\n",x,x<<2,x>>2);

}

 

6. #define swap1(a,b) a=a+b;b=a-b;a=a-b;

main()

{

int x=5,y=10;

swap1(x,y);

printf("%d %d\n",x,y);

swap2(x,y);

printf("%d %d\n",x,y);

}

int swap2(int a,int b)

{

int temp;

temp=a;

b=a;

a=temp;

return;

}

 

7. main()

{

char *ptr = "Ramco Systems";

(*ptr)++;

printf("%s\n",ptr);

ptr++;

printf("%s\n",ptr);

}

 

8. #include

main()

{

char s1[]="Ramco";

char s2[]="Systems";

s1=s2;

printf("%s",s1);

}

 

9. #include

main()

{

char *p1;

char *p2;

p1=(char *) malloc(25);

p2=(char *) malloc(25);

strcpy(p1,"Ramco");

strcpy(p2,"Systems");

strcat(p1,p2);

printf("%s",p1);

}

 

10.enum day = { jan = 1 ,feb=4, april, may}

what is the value of may?

a)4 b)5 c)6 d)11

e)none of the above

 

11.main

{

int x,j,k;

j=k=6;x=2; ans x=1

x=j*k;

printf("%d", x);

 

12. fn f(x)

 

{ if(x<=0)

return; ans fn(5) ....?

else f(x-1)+x;

 

? Help M Main Menu P PrevMsg

return; ans fn(5) ....?

else f(x-1)+x;

}

 

13. i=20,k=0;

for(j=1;j

{

k+=j<10?4:3;

}

 

printf("%d", k); ans k=4

 

14.. int i =10

main()

{

int i =20,n;

for(n=0;n<=i;)

{

int i=10

i++;

 

? Help M Main Menu P PrevMint i=10

i++;

}

printf("%d", i); ans i=20

 

15. int x=5;

y= x&y

( MULTIPLE CHOICE QS)

ans : c

 

16. Y=10;

if( Y++>9 && Y++!=10 && Y++>10)

printf("........ Y);

else printf("".... )

ans : 13

 

17. f=(x>y)?x:y

a) f points to max of x and y8. f=(x>y)?x:y

a) f points to max of x and y

b) f points to min of x and y

c)error

d) ........

ans : a

 

18.. if x is even, then

 

(x%2)=0

x &1 !=1

x! ( some stuff is there)

 

a)only two are correct

b) three are correct

c), d) ....

c), d) ....

ans : all are correct

 

19. which of the function operator cannot be over loaded

 

a) <= b)?: c)== d)*

 

ans: b and d

 

Citicorp Placement Paper 2006 (Aptitude , Reasoning & Technical)

 

1) In a storage stall of 5x3x2inch.How many blanks of size 2x1x1inch can be stored..(ans:15)

 

2) In a company 3/5 of people know shorthand 1/4th know typing and 1/5 know both. What fraction of people do not know both.. (ans:35%)

 

3) A man how many bikes of Rs 14000 can buy by selling 2100 bikes of Rs500/- of each (ans: 75)

 

4) A company requires 11,500 strength. present employees are 200 women , men and 6500 unmarried To reach the target how many women required to maintain the same ratio (ans : 300)

 

5)A man walks from 9.15 to 5.15 from Monday to Friday and 9.00 to 12.00 on Saturday. Each day 0.45 min lunch. How much time he walks in a week...(ans: 39hrs15min).

 

6) 12 revolutions takes 1/8 the second time. In 20 seconds how many revolutions...(ans:1920)

 

7) In 60 reams of paper 40 reams were utilized then what percent will remain...(ans:33.33%)

 

8) A started at 9.00 am with 6 mph and B started at 9.30 am with 8mph in the same direction. At what time they will meet... (ans:11.00am)

 

ANALYTICAL REASONING

 

1) Five persons A,B,C,D and E were travelling in a car.They were two ladies in the group. Of them who knew the car driving one was a lady.A is brother of D.B wifeof D,drve at the begining. E drive at the end.

 

1)Which of the following is a pair of brothers.(ans:A,D)

2)Who was the other lady in the group.(ans:C)

3)In the case of which the following pairs,no relationship can be established with one else in the group (ans:C,E)

4)How was E related to A.(ans:DATA INADEQUATE)

 

2) A man said to woman " your only brother's son is my wife's brother". How is the woman related to the man's wife...(ans:AUNT)

 

C paper

 

1. fn f(x)

{ if(x<=0)

return; ans fn(5) ....?

else f(x-1)+x;

}

 

2. i=20,k=0;

for(j=1;j

{

k+=j<10?4:3;

}

 

printf("%d", k); ans k=4

 

3. int i =10

main()

{

int i =20,n;

for(n=0;n<=i;)

{

int i=10

i++;

}

printf("%d", i); ans i=20