main()
{
float a=3.2e40;
printf("%d",a);
}

Answers were Sorted based on User's Feedback



main() { float a=3.2e40; printf("%d",a); }..

Answer / pankaj bhalerao

i run this and i found that the answer is zero because a
is declared as float and it is print ans integer and its
mantissa part is also a float therefore the output is zero.

thank you...

Is This Answer Correct ?    12 Yes 2 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / pushpanjali panda

after running the program i got the answer is 0.

Is This Answer Correct ?    8 Yes 0 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / iftekhar

main()
{
int i=300*300/300;
printf("%d",i);
}

Is This Answer Correct ?    12 Yes 9 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / vignesh1988i

as for as i know ,
here however 'a' is a float variable when it comes
to printf , the floating numbers will be truncated and it
outputs as 3


thank u

Is This Answer Correct ?    11 Yes 9 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / shashikanth

0

Is This Answer Correct ?    1 Yes 1 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / rajendra chouhan

0

Is This Answer Correct ?    0 Yes 0 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / deepali chandra

the o/p=0
because here we are trying to print the value in int form
which has been of float datatype.since float has a higher
precendence over int therefore it will give the o/p=0 and
similarly after this every output will be =0.this is the
function of the compiler that we cannot print the value of
a higher data type using a lower datatype.

Is This Answer Correct ?    0 Yes 1 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / siva

a is declared as float but it is printed as integer so it
must be wrong.........

Is This Answer Correct ?    0 Yes 1 No

main() { float a=3.2e40; printf("%d",a); }..

Answer / vinaykumar

it is not execute, bcz in the printf satement declared as
integer so answer is 0.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

What language is c written?

0 Answers  


why Language C is plateform dependent

3 Answers   Siemens, Wipro,


How Many Header Files in c?

2 Answers   TCS,


What is the difference between NULL and NUL?

0 Answers   Aspire, Infogain,


What is the size of enum in c?

0 Answers  






Write a program to print “hello world” without using semicolon?

0 Answers  


what is the difference between declaration ,defenetion and initialization of a variable?

7 Answers   LG Soft,


Is there a built-in function in C that can be used for sorting data?

0 Answers  


tell me the full form of c?

2 Answers  


What is a macro?

0 Answers  


Design a program using an array that searches a number if it is found on the list of the given input numbers and locate its exact location in the list.

4 Answers  


any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above

0 Answers  


Categories