Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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 / 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 / iftekhar

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

Is This Answer Correct ?    8 Yes 7 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

print pattern 1 1 33 33 555 555 77777777 555 555 33 33 1 1

1 Answers   Winit,


how to set Nth bit of variable by using MACRO

3 Answers   HCL,


State the difference between x3 and x[3].

0 Answers   Aricent,


I have an array of 100 elements. Each element contains some text. i want to: append a star character to the end of every fifth element remove every second character from every tenth element, and… add a line feed (ascii 10) after the 30th character of every array element whose length is greater than 30 characters.

1 Answers  


What are pointers? What are different types of pointers?

0 Answers   Fidelity,






Describe newline escape sequence with a sample program?

0 Answers  


the maximum length of a character constant can be a) 1 character b) 8 characters c) 256 chaacters d) 125 characters

0 Answers  


main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above

0 Answers  


what is void pointer?

1 Answers   Wipro,


Explain can the sizeof operator be used to tell the size of an array passed to a function?

0 Answers  


How is actual parameter different from the formal parameter?

0 Answers  


develop algorithms to add polynomials (i) in one variable

0 Answers   Ignou, TCS,






Categories