#include<conio.h>
main()
{
int x,y=2,z,a;
if(x=y%2) z=2;
a=2;
printf("%d %d ",z,x);
}
Answer / susie
Answer :
Garbage-value 0
Explanation:
The value of y%2 is 0. This value is assigned to x. The
condition reduces to if (x) or in other words if(0) and so z
goes uninitialized.
Thumb Rule: Check all control paths to write bug free
code.
| Is This Answer Correct ? | 5 Yes | 1 No |
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
String reverse with time complexity of n/2 with out using temporary variable.
How do you write a program which produces its own source code as its output?
given integer number,write a program that displays the number as follows: First line :all digits second line : all except the first digit . . . . Last line : the last digit
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
void func1(int (*a)[10]) { printf("Ok it works"); } void func2(int a[][10]) { printf("Will this work?"); } main() { int a[10][10]; func1(a); func2(a); } a. Ok it works b. Will this work? c. Ok it worksWill this work? d. None of the above
void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }
How can you relate the function with the structure? Explain with an appropriate example.
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
main() { int i=5,j=6,z; printf("%d",i+++j); }
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }