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 macro execution is faster than function ?

0 Answers   Wipro,


What is an arrays?

0 Answers  


How can I get back to the interactive keyboard if stdin is redirected?

0 Answers  


how to calculate the time complexity of a given algorithm? pls give exaples..mainly for the coplexities such as O(log n),O(n log n)...

1 Answers   Infosys,


What is period operator in c?

3 Answers   Wipro,






44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

3 Answers  


Which is best linux os?

0 Answers  


how to execute with out main in cprogram

15 Answers   Infosys,


What is difference between array and structure in c?

0 Answers  


Write a c program to build a heap method using Pointer to function and pointer to structure ?

0 Answers   Wipro,


Why is c used in embedded systems?

0 Answers  


How many types of operator or there in c?

0 Answers  


Categories