Find the output?
void main()
{float a=2.0;
printf("\nSize of a ::%d",sizeof(a));
printf("\nSize of 2.0 ::%d",sizeof(2.0));}

Answers were Sorted based on User's Feedback



Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / shashishekhar.eg

Size of a ::4
Size of 2.0 ::8

Is This Answer Correct ?    17 Yes 6 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / aravind

ok guys.
Here ans is 4 and 4.
I think %d specifier is for integer and it takes a=2 and prints 4 bytes for gcc and 2 bytes for turbo. Sizeof(2.0) also takes %d integer specifier and prints 4.

Is This Answer Correct ?    4 Yes 1 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / musa

Size of a ::4
Size of 2.0 ::8

Is This Answer Correct ?    2 Yes 0 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / ricky dobriyal

hello fnd..i am ricky dobriyal

output:-

Size of a =4
Size of 2.0=8 /* because of double*/

Is This Answer Correct ?    1 Yes 1 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / manish soni tagore collage jai

here a as a float so 4bytes
and 2.0 is work as double.
when 2.0f work as a flaot so .
sizeof(2.0f)is 4 byte

Is This Answer Correct ?    0 Yes 1 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / pankaj khurana

size of a:: 4
size of 2.0::4

Is This Answer Correct ?    0 Yes 2 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / deepshree sinha

2
2

Is This Answer Correct ?    0 Yes 3 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / chandrashekhar

In turbo c
a::2
2.0::2

GCC
a::4
2.0::2

Is This Answer Correct ?    0 Yes 3 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / rajeswari sethu

hi guys my answer is 2,2

Is This Answer Correct ?    0 Yes 6 No

Find the output? void main() {float a=2.0; printf("\nSize of a ::%d",sizeof(a..

Answer / selvapriya

hi frnds...i think my ans is 2,2

Is This Answer Correct ?    0 Yes 6 No

Post New Answer

More C Interview Questions

What are the c keywords?

0 Answers  


what is the benefit of c30

2 Answers  


write a program that print itself even if the source file is deleted?

2 Answers  


How do you access command-line arguments?

1 Answers  


Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.

0 Answers   Infosys,






How will you write a code for accessing the length of an array without assigning it to another variable?

0 Answers  


Write a program which returns the first non repetitive character in the string?

0 Answers   Expedia,


Why is python slower than c?

0 Answers  


Why n++ execute faster than n+1 ?

2 Answers  


Write a program to print a (*)pattern programming (A to Z) in capital in one programming ?

2 Answers   TCS,


Is the C language is the portable language...If yes...Then Why...and if not then what is problem so it is not a Portable language..???

2 Answers   TCS,


how to make c program without a libary? e.g.#include<stdio.h> libary is not in c progaram.

2 Answers  


Categories