#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 return a multiple value from a function?
Given n nodes. Find the number of different structural binary trees that can be formed using the nodes.
16 Answers Aricent, Cisco, Directi, Qualcomm,
main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }
Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.
void main() { int *mptr, *cptr; mptr = (int*)malloc(sizeof(int)); printf(ā%dā,*mptr); int *cptr = (int*)calloc(sizeof(int),1); printf(ā%dā,*cptr); }
What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }
#define f(g,g2) g##g2 main() { int var12=100; printf("%d",f(var,12)); }
Program to Delete an element from a doubly linked list.
4 Answers College School Exams Tests, Infosys,
Display the time of the system and display the right time of the other country
main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256
How do you write a program which produces its own source code as its output?
void main() { int const * p=5; printf("%d",++(*p)); }
3 Answers Infosys, Made Easy, State Bank Of India SBI,