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

#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }

1 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  


Write a procedure to implement highlight as a blinking operation

2 Answers  


main() { int *j; { int i=10; j=&i; } printf("%d",*j); }

9 Answers   HCL, Wipro,


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

1 Answers  






how to concatenate the two strings

1 Answers  


write a c program to Create employee record by taking details like name, employee id, address and phone number. While taking the phone number, take either landline or mobile number. Ensure that the phone numbers of the employee are unique. Also display all the details

2 Answers   TCS,


How to count a sum, when the numbers are read from stdin and stored into a structure?

1 Answers  


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

2 Answers  


main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }

1 Answers  


write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??

0 Answers   Nagarro,


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


Categories