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

4)What would be the output? main() { int num=425; pf("%d",pf("%d",num)); } a)Comp error b)4425 c)4253 d)3435 e)none

10 Answers  


What are the scope of static variables?

0 Answers  


List some applications of c programming language?

0 Answers  


write the output of following code .. main() { static int a[]={10,20,30,40,50}; int *ptr=a; static int arr[2][2]={1,2,3,4}; char str[]="ABCD * 4#"; char *s=str+2; int i,j; for(i=0;i<5,i++) printf("%d",*ptr++); for(i=0;i<2;i++) for(j=0;j<2;j++) printf("%d\n",*(*(n+i)+j)); printf("%c\n%c\n%c\n",*(str+2),*s++,*--s); }

1 Answers  


How do I use void main?

0 Answers  






Program to display given 3 integers in ascending order

1 Answers   N Tech,


Suppose we have a table name EMP as below. We want to perform a operation in which, I want to change name ‘SMITH’ from as ‘SMITH JAIN’. Also I want to change the name of the column from ENAME to E_NAME. EMPNO ENAME JOB MGR HIREDATE SAL 7369 SMITH Coder 7902 17-DEC-80 800 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250

0 Answers  


How can I find out how much memory is available?

1 Answers   Persistent,


What is modeling?

0 Answers  


Explain how can I make sure that my program is the only one accessing a file?

0 Answers  


WHAT IS LOW LEVEL LANGUAGE?

2 Answers  


Explain what are linked list?

0 Answers  


Categories