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

what's the return value of malloc()

9 Answers  


program to find a smallest number in an array

15 Answers   Microsoft, Sony,


Write a simple program to find the size of different basic data types in C.

3 Answers  


Explain the difference between malloc() and calloc() function?

0 Answers  


What is malloc calloc and realloc in c?

0 Answers  






What is the mean of this statement:: if(int i=0 * i=9)

2 Answers   HCL,


What is keyword with example?

0 Answers  


How do you override a defined macro?

0 Answers  


What is your favorite subject?

1 Answers   Ericsson, Invendis, Tech Mahindra,


is compiler do read the data line by line or not. ??

6 Answers   LG Soft, Satyam, Tech Mahindra,


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

0 Answers  


Tell me can the size of an array be declared at runtime?

0 Answers  


Categories