#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 |
How to palindrom string in c language?
int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }
main() { int i = 3; for (;i++=0;) printf(“%d”,i); }
main() { signed int bit=512, mBit; { mBit = ~bit; bit = bit & ~bit ; printf("%d %d", bit, mBit); } } a. 0, 0 b. 0, 513 c. 512, 0 d. 0, -513
3 Answers HCL, Logical Computers,
could you please send the program code for multiplying sparse matrix in c????
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
void main() { static int i=i++, j=j++, k=k++; printf(“i = %d j = %d k = %d”, i, j, k); }
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }
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
Finding a number multiplication of 8 with out using arithmetic operator
¦void main() ¦{ ¦int i=10,j; ¦ j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-30 but in same question if we write as- ¦void main() ¦{ ¦int i=10; ¦ int j=i+++i+++i; ¦printf("%d",j); ¦getch(); ¦} ¦ output:-33 why output is changed from 30 to 33. Can any body answer...