Placement Papers - Citicorp
Citicorp Placement Paper (Technical Section)
Posted by :
Amrit S. Saxena
(20)
Paper: 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
",x,y);
}
9.int x;
main()
{
int x=0;
{
int x=10;
x++;
change_value(x);
x++;
Modify_value();
printf("First output: %d
",x);
}
x++;
change_value(x);
printf("Second Output : %d
",x);
Modify_value();
printf("Third Output : %d
",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
",x,y);
}
11.main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s
",p2);
}
12.main()
{
int x=5;
printf("%d %d %d
",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
",x,y);
swap2(x,y);
printf("%d %d
",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
",ptr);
ptr++;
printf("%s
",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);
}
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
",x,y);
}
9.int x;
main()
{
int x=0;
{
int x=10;
x++;
change_value(x);
x++;
Modify_value();
printf("First output: %d
",x);
}
x++;
change_value(x);
printf("Second Output : %d
",x);
Modify_value();
printf("Third Output : %d
",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
",x,y);
}
11.main()
{
char *p1="Name";
char *p2;
p2=(char *)malloc(20);
while(*p2++=*p1++);
printf("%s
",p2);
}
12.main()
{
int x=5;
printf("%d %d %d
",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
",x,y);
swap2(x,y);
printf("%d %d
",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
",ptr);
ptr++;
printf("%s
",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);
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers