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
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 |
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 |
How macro execution is faster than function ?
What is an arrays?
How can I get back to the interactive keyboard if stdin is redirected?
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)...
What is period operator in c?
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?
Which is best linux os?
how to execute with out main in cprogram
What is difference between array and structure in c?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Why is c used in embedded systems?
How many types of operator or there in c?