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 |
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
why array index always strats wuth zero?
1) int i=5; j=i++ + i++ + i++; printf("%d",j);This code gives the answer 15.But if we replace the value of the j then anser is different?why? 2)int i=5; printf("%d",i++ + i++ + i++); this givs 18.
main() { int i=0; for(;i++;printf("%d",i)) ; printf("%d",i); }
Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it.
write a origram swaoing valu without 3rd variable
Write a C function to search a number in the given list of numbers. donot use printf and scanf
int aaa() {printf(“Hi”);} int bbb(){printf(“hello”);} iny ccc(){printf(“bye”);} main() { int ( * ptr[3]) (); ptr[0] = aaa; ptr[1] = bbb; ptr[2] =ccc; ptr[2](); }
#define assert(cond) if(!(cond)) \ (fprintf(stderr, "assertion failed: %s, file %s, line %d \n",#cond,\ __FILE__,__LINE__), abort()) void main() { int i = 10; if(i==0) assert(i < 100); else printf("This statement becomes else for if in assert macro"); }
what is the output of the below program & why ? #include<stdio.h> void main() { int a=10,b=20,c=30; printf("%d",scanf("%d%d%d",&a,&b,&c)); }
#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }