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
Answer / vijay
main()
{
static int i;
printf("%d \n",i++);
main();
}
Is This Answer Correct ? | 3 Yes | 19 No |
main() { char *p; p="%d\n"; p++; p++; printf(p-2,300); }
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
enum colors {BLACK,BLUE,GREEN} main() { printf("%d..%d..%d",BLACK,BLUE,GREEN); return(1); }
main() { unsigned char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
write a c program to Reverse a given string using string function and also without string function
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()); }
#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s; printf("%d",s->x); printf("%s",s->name); }
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
void main() { static int i; while(i<=10) (i>2)?i++:i--; printf(“%d”, i); }
main() { int i = 100; clrscr(); printf("%d", sizeof(sizeof(i))); } a. 2 b. 100 c. 4 d. none of the above
main() { int i=5; printf("%d%d%d%d%d%d",i++,i--,++i,--i,i); }