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 |
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].
suppose there are five integers write a program to find larger among them without using if- else
how to find the given number is prime or not?
How do I round numbers?
How can I determine whether a machines byte order is big-endian or little-endian?
Write a c program for sum of first n terms of the series S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......
Is exit(status) truly equivalent to returning the same status from main?
What is binary tree in c?
Can we change the value of #define in c?
Write a program to produce the following output in c language? 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
can we declare a function in side the structure?
what is differnence b/w macro & functions