what will be the output of this program?

#include<stdio.h>
#define cube(x) x*x*x

void main()
{
int i,j=5;
i=cube(j+3);
printf("i=%d",i);
}

Answers were Sorted based on User's Feedback



what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / sinchanforyou

It prints:

i=38

Is This Answer Correct ?    25 Yes 10 No

what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / bala prasad

it prints
512

Is This Answer Correct ?    17 Yes 10 No

what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / vijay r15

ans 38
it will pass as (5+3)

So the operation will be as
5+3*5+3*5+3
Hence
5+15+15+3=38

Got it


With thanks and regards,
Vijay r15
raj.vijay55@gmail.com

Is This Answer Correct ?    8 Yes 2 No

what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / sunil samal

38 because above declared the pree processer directive # defind cube (x) x*x*x

it passes the value (5+3)to the above directive
So the operation will be as
5+3*5+3*5+3
Hence
5+15+15+3=38

Is This Answer Correct ?    5 Yes 1 No

what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / udai

512

Is This Answer Correct ?    8 Yes 6 No

what will be the output of this program? #include<stdio.h> #define cube(x) x*x*x void m..

Answer / srikanth karnati

please explain this program.

Is This Answer Correct ?    0 Yes 2 No

Post New Answer

More C Interview Questions

how to add numbers without using arithmetic operators.

14 Answers   TCS,


How do I declare an array of N pointers to functions returning pointers to functions returning pointers to characters?

2 Answers   CMC, Wipro,


How will you write a code for accessing the length of an array without assigning it to another variable?

0 Answers  


When c language was developed?

0 Answers  


write a program that print itself even if the source file is deleted?

2 Answers  


What is c basic?

0 Answers  


#define MAX(x,y) (x) >(y)?(x):(y) main() { inti=10,j=5,k=0; k= MAX(i++,++j); printf("%d..%d..%d",i,j,k); }

0 Answers   Wilco,


What library is sizeof in c?

0 Answers  


advantages of pointers?

3 Answers  


Explain data types & how many data types supported by c?

0 Answers  


Explain what header files do I need in order to define the standard library functions I use?

0 Answers  


Write a program in c to replace any vowel in a string with z?

0 Answers   IBS,


Categories