#include<conio.h>

main()

{

int x,y=2,z,a;

if(x=y%2) z=2;

a=2;

printf("%d %d ",z,x);

}



#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf(&qu..

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

Post New Answer

More C Code Interview Questions

What is your nationality?

1 Answers   GoDB Tech,


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  


void main() { int i=i++,j=j++,k=k++; printf(“%d%d%d”,i,j,k); }

1 Answers  


main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

1 Answers  


Write a program that find and print how many odd numbers in a binary tree

1 Answers  






Write a routine to draw a circle (x ** 2 + y ** 2 = r ** 2) without making use of any floating point computations at all.

2 Answers   Mentor Graphics, Microsoft,


What is full form of PEPSI

0 Answers  


how can u draw a rectangle in C

53 Answers   Accenture, CO, Codeblocks, Cognizant, HCL, Oracle, Punjab National Bank, SAP Labs, TCS, University, Wipro,


int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }

1 Answers  


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


Find your day from your DOB?

15 Answers   Accenture, Microsoft,


Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..

2 Answers  


Categories