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

Explain the differences between public, protected, private and internal.

2 Answers  


How to calculate sum

2 Answers  


accept character from keyboard untill the user presses the enter key.If the user enters any character other than upper case(A-Z)alphabets program should stop taking any input

1 Answers  


Write a program to print factorial of given number using recursion?

0 Answers  


What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.

0 Answers   IBM,






what is the output of below pgm? void main() { int i=0; if(i) printf("pass"); else printf("fail"); }

4 Answers  


Question 1: You want to conduct a survey within your classroom, on the quality of canteen’s food. You ask each of your class fellows to rank the quality of food between 1 and 5 (1 representing excellent quality and 5 representing worst quality). During the survey, you make a list containing the roll# of student and the opinion given by that student. The list can be as follow Roll # Opinion 234 1 235 1 236 5 237 1 238 2 239 3 240 5 241 5 242 1 To get the results of the survey, you need to determine the frequency of each opinion value. The frequency of an opinion is determined by counting the number of students giving that opinion. For example, for the above list the frequency of opinion value 1 is 4 and frequency of opinion value 4 is 0. After getting the frequency of each opinion, you can easily judge about the quality of the food by seeing through the frequency of each opinion. You need to develop a program to calculate the results of this survey. The program inputs the opinion of 50 students and counts the frequency of each opinion. It then displays a report showing the frequency of each opinion. Sample output: Opinion Frequency Remarks 1 5 Excellent 2 10 Good 3 15 Normal 4 10 Bad 5 10 Really bad

1 Answers  


What is a pragma?

0 Answers  


main() { char ch='356'; Printf("%d",ch); } *OUTPUT*:- -18 *Why?*

1 Answers  


What is #line?

0 Answers  


What does char * * argv mean in c?

0 Answers  


Which is better oop or procedural?

0 Answers  


Categories