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));}

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between break and continue?

609


What are the different data types in C?

731


Explain the use of keyword 'register' with respect to variables.

593


What is the basic structure of c?

561


Explain what math functions are available for integers? For floating point?

618






What is the correct declaration of main?

681


Explain what does it mean when a pointer is used in an if statement?

621


Are enumerations really portable?

598


What is meant by preprocessor in c?

540


Explain what are multidimensional arrays?

607


What is the use of a semicolon (;) at the end of every program statement?

780


How can I pad a string to a known length?

614


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1574


What is the purpose of sprintf?

625


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1863