3rd step to ZOHO - Technical Aptitude - June 17th 2016
TECHNICAL
APTITUDE
1.What
will be the output of the program?
#include
int main()
{
extern int a;
printf("%d\n", a);
return 0;
} int a=20;
2.Point out the error in the
following program.
|
||
include
int
main(){ void v = 0;printf("%d", v); return 0;}
3.
What will be the output of the program?
What
will be the output of the program?
#include
int
main(){ const int i=0; printf("%d\n", i++); return 0;}
4.What
will be the output of the program?
#include
int
main(){ typedef int arr[5]; arr iarr = {1, 2, 3, 4, 5}; int i; for(i=0; i<4; i++) printf("%d,", iarr[i]); return 0;}
5. What will be the output of the
program?
main()
{
printf(“\nab);
printf(“\bsi”);
printf(“\rha”);
}
6. What will be the output of the
program?
#include
#define
clrscr() 100
main()
{
clrscr();
printf(“%d”,clrscr());
}
7.
What will be the output of the program?
main()
{
int
a[2][3][2]={{{2.4},{7,8},{3,4}}{{2,2},{2,3},{3,4}}};
printf(“%u%u%u%d\n”,a,*a,**a,***a):
printf(“%u%u%u%d\n”,a+1,*a+1,**a+1,***a+1);
}
8.
What will be the output of the program?
main()
{
static char *s[]={“black”,”white”,”yellow”,”violet”};
char **ptr[]={s+3,s+2,s+1,s},**p;
p=ptr;
**++p;
printf(“%s”,*--*++p + 3);
}
9.
What will be the output of the program?
main()
{
int i,n;
char *x=”girl”;
n=strlen(x);
*x=x[n];
for(i=0;i
{
printf(“%s\n”,x);
x++;
}
}
10.
What will be the output of the program?
main()
{
int
i=-1;
+i;
printf(“i=%d,+i=%d\n”,i,+i);
}
11.
What will be the output of the program?
#define
FALSE -1
#define
TRUE 1
#define
NULL 0
main()
{
if(NULL)
puts("NULL");
else
if(FALSE)
puts("TRUE");
else
puts("FALSE");
}
}
12.
What will be the output of the program?
#include<stdio.h>
int main()
{
float a = 0.3;
if(0.3 > a)
printf("True\n");
else
printf("False\n");
return 0;
}
13.
What will be the output of the program?
#include<stdio.h>
int main()
{
if(printf("ABC"))
printf("True");
else
printf("False");
return 0;
}
14.
What will be the output of the program?
#include<stdio.h>
int main()
{
int i = 1, j = 2;
if(i = 1) && if(j = 2)
printf("India is my country");
return 0;
}
15.
What will be the output of the program?
main()
{
char
*cptr,c;
void
*vptr,v;
c=10;
v=0;
cptr=&c;
vptr=&v;
printf("%c%v",c,v);
}

Comments
Post a Comment