21. #include
int main()
{
int k=5;
for(++k<5 && k++/5 || ++k<8);
printf("%d\n",k);
}
Answer: 7
Explanation:Here is no explanation for this answer
Workspace
Global Edge
22. #include
int main()
{
int *ptr1,*ptr2;
ptr1=(int *)malloc(sizeof(int));
ptr2=func(20,10,ptr1);
printf("%d %d\n",*ptr1,*ptr2);
}
int *func(int a, int b, int *c)
{
int x=a+b;
*c=a-b;
return(&x);
}
Answer: Bug in the code
Explanation:Here is no explanation for this answer
Workspace
Global Edge
23. #include
int main()
{
int i = 10, j ;
if ( ( j = ~i ) < i )
printf ( "True" ) ;
else
printf ( "False" ) ;
}
Answer: TRUE
Explanation:Here is no explanation for this answer
Workspace
Global Edge
24. How many bytes are required to create a 3*3 matrix using double pointer
Answer: 12
Explanation:Here is no explanation for this answer
Workspace
Global Edge
25. void main() {
FILE *fp;
printf("%d\n",sizeof(fp) );
}
Answer: 4
Explanation:Here is no explanation for this answer
Workspace
Global Edge
26. #include
int main()
{
int a=10,b=20;
a^=b^=a^=b;
printf("%d\n %d\n",a,b);
}
Answer: a=20,b=10
Explanation:Here is no explanation for this answer
Workspace
Global Edge
27. #include
int main()
{
int i=10;
switch(i) {
case 10: printf("Hello "); {
case 1 : printf("World ");
}
case 5: printf("Hello World ");
}
}
Answer: Hello World Hello World
Explanation:Here is no explanation for this answer
Workspace
Global Edge
28. #include
int main()
{
char str1[]="Hello";
char str2[]="Hello";
if ( str1==str2 )
printf("True\n");
else
printf("False\n");
}
Answer: FALSE
Explanation:Here is no explanation for this answer
Workspace
Global Edge
29. #include
int main()
{
int i = 10 ;
printf("%d\n", i/2 );
}
Answer: 5
Explanation:Here is no explanation for this answer
Workspace
Global Edge
30. #include
# pragma pack(2)
struct SIZE {
int i;
char ch ;
double db ;
} ;
main () {
printf ( "%d\n",sizeof(struct SIZE) );
}
Answer: 14
Explanation:Here is no explanation for this answer
Workspace
Global Edge