Aspire Placement Paper - 2


1. #define dprintf(expr) printf(#expr="%d",exp);
main()
{int x=7, y=3;
dprintf(x/y);}

2. Int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d,%d,%d,%d,i,j,k,l,m);

3.struct s
{int x, float y}s1={24,45.0};
union u
{ int x, float y} u1=(union u)s1;
printf("%d,%f,u1.x,u1.y);

4.#define var(a,b) (a*b)/(a-b)
main()
{
int a=20, b=10,c
c=var(a+4,b-2);
printf("%d",c)
}

5. Char *g()
{
static char x[1000];
return x;
}
main()
{
char *g1="string one";
strcpy(g(),g1);
g1=g();
strcpy(g1,"string two");
printf("%s",g());---->i don't remeber that here g(), g1,prepare both
}
6. Int k=5;
if(++k<5&&k++5.); -->here there was a semicolon after if statement, so careful
printf("%d",k);

7. #define var(a,f,g,)
#define .
#define .
,, ,,
,, ,,
main()
{
#if def cat
printf("cat");
#else
printf("tiger");
}

Aspire placement paper

Aspire
placement paper-1

Aspire placement paper

Aspire
placement paper-3

Aspire placement paper

Aspire
placement paper-4