#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 |
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
x=2 y=3 z=2 x++ + y++; printf("%d%d" x,y);
main() { extern out; printf("%d", out); } int out=100;
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
main() { { unsigned int bit=256; printf("%d", bit); } { unsigned int bit=512; printf("%d", bit); } } a. 256, 256 b. 512, 512 c. 256, 512 d. Compile error
main() { static char names[5][20]={"pascal","ada","cobol","fortran","perl"}; int i; char *t; t=names[3]; names[3]=names[4]; names[4]=t; for (i=0;i<=4;i++) printf("%s",names[i]); }
write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .
how can i search an element in an array
2 Answers CTS, Microsoft, ViPrak,
how to return a multiple value from a function?
How to use power function under linux environment.eg : for(i=1;i<=n;i++){ pow(-1,i-1)} since it alerts undefined reference to 'pow'.
#include<stdio.h> main() { int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} }; int *p,*q; p=&a[2][2][2]; *q=***a; printf("%d----%d",*p,*q); }