C Programming - Typedef - Discussion

Discussion Forum : Typedef - Find Output of Program (Q.No. 3)
3.
What will be the output of the program?
#include<stdio.h>

int main()
{
    typedef int LONG;
    LONG a=4;
    LONG b=68;
    float c=0;
    c=b;
    b+=a;
    printf("%d,", b);
    printf("%f\n", c);
    return 0;
}
72, 68.000000
72.000000, 68
68.000000, 72.000000
68, 72.000000
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
7 comments Page 1 of 1.

Silambarasan said:   6 years ago
Thanks @Divya.

Vidya said:   7 years ago
Thanks @Divya.

Nivedita said:   8 years ago
Thanks @Divya.

Shamal kashid said:   9 years ago
I understood the concept. Thanks, @Divya.

Divya said:   1 decade ago
int a=4;
int b=68;
float c=0

Then c=b;
c=68;(it is float it can be represent in 68.0000) (b=68)
b+=a;
b=b+a;
b=68+4;
b=72;(integer)
Ans:(72, 68.0000)
(1)

Mayur said:   1 decade ago
Can anyone explain it?

Krishnamoorthy said:   1 decade ago
LONG a=4; /* it means int a=4 */
LONG b=68; /* it means int b=68 */

Post your comments here:

Your comments will be displayed after verification.