#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



#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225..

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

#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225..

Answer / guest

b) 225

Is This Answer Correct ?    22 Yes 6 No

#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225..

Answer / srividya h r

a.1

Is This Answer Correct ?    4 Yes 13 No

Post New Answer

More C Code Interview Questions

main() { int i=-1,j=-1,k=0,l=2,m; m=i++&&j++&&k++||l++; printf("%d %d %d %d %d",i,j,k,l,m); }

1 Answers  


#define prod(a,b) a*b main() { int x=3,y=4; printf("%d",prod(x+2,y-1)); }

1 Answers  


What is the hidden bug with the following statement? assert(val++ != 0);

1 Answers  


find A^B using Recursive function

2 Answers  


main() { float i=1.5; switch(i) { case 1: printf("1"); case 2: printf("2"); default : printf("0"); } }

2 Answers  






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.

8 Answers   IBPS, Infosys, TCS,


#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }

1 Answers  


Write a program to implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector

2 Answers  


How to swap two variables, without using third variable ?

104 Answers   AB, ADP, BirlaSoft, Cisco, Cygnet Infotech, HCL, Hewitt, Honeywell, HP, IBM, Infosys, Manhattan, Microsoft, Mobius, Percept, Satyam, SofTMware, TCS, Wipro, Yamaha,


write a program to count the number the same (letter/character foreg: 's') in a given sentence.

2 Answers  


Write a routine that prints out a 2-D array in spiral order

3 Answers   Microsoft,


main( ) { void *vp; char ch = ‘g’, *cp = “goofy”; int j = 20; vp = &ch; printf(“%c”, *(char *)vp); vp = &j; printf(“%d”,*(int *)vp); vp = cp; printf(“%s”,(char *)vp + 3); }

1 Answers  


Categories