main()

{

int x=5;

clrscr();

for(;x==0;x--) {

printf("x=%d\n”", x--);

}

}

a. 4, 3, 2, 1, 0

b. 1, 2, 3, 4, 5

c. 0, 1, 2, 3, 4

d. none of the above

Answers were Sorted based on User's Feedback



main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / guest

d) prints nothing, as condition x==0 is False

Is This Answer Correct ?    11 Yes 0 No

main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / ana

nothing

Is This Answer Correct ?    4 Yes 0 No

main() { int x=5; clrscr(); for(;x==0;x--) { printf("x=%d\n”", ..

Answer / ranjith v

d:None of the above
Explanation:
In for loop the condition x==0,i.e;x0 is assigned to
zero.which means x value will be 0 not the 5.so it causes error.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More C Code Interview Questions

main() { char a[4]="HELL"; printf("%s",a); }

3 Answers   Wipro,


main() { int c[ ]={2.8,3.4,4,6.7,5}; int j,*p=c,*q=c; for(j=0;j<5;j++) { printf(" %d ",*c); ++q; } for(j=0;j<5;j++){ printf(" %d ",*p); ++p; } }

1 Answers  


Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };

1 Answers  


x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);

2 Answers  


main() { char not; not=!2; printf("%d",not); }

1 Answers  






print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


what is brs test reply me email me kashifabbas514@gmail.com

0 Answers  


You are given any character string. Find the number of sets of vowels that come in the order of aeiou in the given string. For eg., let the given string be DIPLOMATIC. The answer returned must be "The number of sets is 2" and "The sets are "IO and AI". Vowels that form a singleton set must be neglected. Try to post the program executable in gcc or g++ or in java.

3 Answers  


main() { int i = 3; for (;i++=0;) printf(“%d”,i); }

1 Answers   CSC,


main() { int i =10, j = 20; clrscr(); printf("%d, %d, ", j-- , --i); printf("%d, %d ", j++ , ++i); } a. 20, 10, 20, 10 b. 20, 9, 20, 10 c. 20, 9, 19, 10 d. 19, 9, 20, 10

4 Answers   HCL,


main(){ int a= 0;int b = 20;char x =1;char y =10; if(a,b,x,y) printf("hello"); }

1 Answers   TCS,


Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.

5 Answers   IITR, Microsoft, Nike,


Categories