C Programming - Complicated Declarations - Discussion

Discussion Forum : Complicated Declarations - Find Output of Program (Q.No. 5)
5.
What will be the output of the program?
#include<stdio.h>
typedef void v;
typedef int i;

int main()
{
    v fun(i, i);
    fun(2, 3);
    return 0;
}
v fun(i a, i b)
{
    i s=2;
    float i;
    printf("%d,", sizeof(i));
    printf(" %d", a*b*s);
}
2, 8
4, 8
2, 4
4, 12
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
19 comments Page 2 of 2.

Prakash said:   1 decade ago
Yes sundar answer 4is correct but how it is 12 can any body explain please.

Priya said:   1 decade ago
But the i is the typdef of int which is of 2 byte than why 4 ?

Shyam said:   8 years ago
Hi, please explain the 3 bit which is given to b.

LAVANYA said:   10 years ago
Can you explain this I can't understand?

Udhaya said:   9 years ago
typedef void i means? Anyone explain me.

Neha said:   9 years ago
Please, anybody explain the value of i.

Sharath said:   1 decade ago
How sizeof(i) is 4 ? Please explain.

Bhavya said:   1 decade ago
Yes. Sundar is correct.

Sunil said:   1 decade ago
i is declared as float.


Post your comments here:

Your comments will be displayed after verification.