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

Answers were Sorted based on User's Feedback



print numbers till we want without using loops or condition statements like specifically(for,do wh..

Answer / vijay

main()
{
static int i;
printf("%d \n",i++);
main();
}

Is This Answer Correct ?    3 Yes 19 No

Post New Answer

More C Code Interview Questions

main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }

1 Answers  


main() { int (*functable[2])(char *format, ...) ={printf, scanf}; int i = 100; (*functable[0])("%d", i); (*functable[1])("%d", i); (*functable[1])("%d", i); (*functable[0])("%d", &i); } a. 100, Runtime error. b. 100, Random number, Random number, Random number. c. Compile error d. 100, Random number

1 Answers   HCL, rsystems,


enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }

2 Answers  


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

1 Answers  


write a c program to Reverse a given string using string function and also without string function

1 Answers  






char *someFun1() { char temp[ ] = “string"; return temp; } char *someFun2() { char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’}; return temp; } int main() { puts(someFun1()); puts(someFun2()); }

2 Answers  


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }

3 Answers   Hexaware,


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }

2 Answers  


main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above

5 Answers   HCL,


main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }

7 Answers  


Categories