main()

{

int x=5;

clrscr();

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

{

printf("x=%d ", x--);

}

}

a. 5, 3, 1

b. 5, 2, 1,

c. 5, 3, 1, -1, 3

d. –3, -1, 1, 3, 5

Answers were Sorted based on User's Feedback



main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d &quo..

Answer / guest

prints nothing, as condition in loop is false.

Is This Answer Correct ?    33 Yes 3 No

main() { int x=5; clrscr(); for(;x<= 0;x--) { printf("x=%d &quo..

Answer / purushotam111

Just change the operator in for >= instead of <=
then our answer is 5 , 3 , 1

Is This Answer Correct ?    16 Yes 2 No

Post New Answer

More C Code Interview Questions

Derive expression for converting RGB color parameters to HSV values

1 Answers  


main() { if ((1||0) && (0||1)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

5 Answers   HCL,


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


main() { clrscr(); } clrscr();

2 Answers  


what is variable length argument list?

2 Answers  






How to read a directory in a C program?

4 Answers  


void main() { int k=ret(sizeof(float)); printf("\n here value is %d",++k); } int ret(int ret) { ret += 2.5; return(ret); }

1 Answers  


Finding a number multiplication of 8 with out using arithmetic operator

8 Answers   Eyeball, NetApp,


How do I write a program to print proper subset of given string . Eg :input: abc output:{},{a},{b},{c},{a,b},{a,c},{b,c}, {a,b,c}.I desperately need this program please mail me to saravana6m@gmail.com

11 Answers   Deshaw, Infosys,


why array index always strats wuth zero?

2 Answers  


why the range of an unsigned integer is double almost than the signed integer.

1 Answers  


main() { int y; scanf("%d",&y); // input given is 2000 if( (y%4==0 && y%100 != 0) || y%100 == 0 ) printf("%d is a leap year"); else printf("%d is not a leap year"); }

1 Answers  


Categories