main()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above
Answers were Sorted based on User's Feedback
Answer / guest
a) 1, if we use main|c then error, illegal use of pointer
| Is This Answer Correct ? | 13 Yes | 3 No |
Answer / saurabh
a. 1, bcz anything||any +ve value(except zero) is true(1).
| Is This Answer Correct ? | 3 Yes | 1 No |
main() { int i=4,j=7; j = j || i++ && printf("YOU CAN"); printf("%d %d", i, j); }
main() { void swap(); int x=10,y=8; swap(&x,&y); printf("x=%d y=%d",x,y); } void swap(int *a, int *b) { *a ^= *b, *b ^= *a, *a ^= *b; }
how to delete an element in an array
main( ) { int a[ ] = {10,20,30,40,50},j,*p; for(j=0; j<5; j++) { printf(“%d” ,*a); a++; } p = a; for(j=0; j<5; j++) { printf(“%d ” ,*p); p++; } }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
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()); }
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
Is the following code legal? typedef struct a aType; struct a { int x; aType *b; };
main() { int i=400,j=300; printf("%d..%d"); }
main() { int i=5; printf("%d",++i++); }
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }