#define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15
d. none of the above
Answers were Sorted based on User's Feedback
Answer / anurag
the macro replacement will change printf to:
printf("%d", 225/15*15);
now, / and * have same priority so
225/15*15 = 15*15 = 225.
So answer is 225
| Is This Answer Correct ? | 24 Yes | 2 No |
#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }
print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!
main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }
write a program to Insert in a sorted list
main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }
What is the hidden bug with the following statement? assert(val++ != 0);
#include<stdio.h> main() { char s[]={'a','b','c','\n','c','\0'}; char *p,*str,*str1; p=&s[3]; str=p; str1=s; printf("%d",++*p + ++*str1-32); }
main() { char *p; p="Hello"; printf("%c\n",*&*p); }
Find your day from your DOB?
15 Answers Accenture, Microsoft,
main() { printf("%d", out); } int out=100;
main() { int k=1; printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE"); }
prog. to produce 1 2 3 4 5 6 7 8 9 10