C Programming
-
#include
#include
int main()
{
double width,hight,area;
printf("enter the value of width");
scanf("%f",&width);
printf("enter the vlaue of hight");
scanf("%f",&hight);
area=width*hight;
printf("area=%f",area);
return 0;
}
Why area=0.000 showing -
#include
#include
int main()
{
double width,hight,area;
printf("enter the value of width");
scanf("%f",&width);
printf("enter the vlaue of hight");
scanf("%f",&hight);
area=width*hight;
printf("area=%f",area);
return 0;
}
Why area=0.000 showingI guess either width is zero or hight is zero or both are zero. :cool:
-
#include
#include
int main()
{
double width,hight,area;
printf("enter the value of width");
scanf("%f",&width);
printf("enter the vlaue of hight");
scanf("%f",&hight);
area=width*hight;
printf("area=%f",area);
return 0;
}
Why area=0.000 showing -
The format specifier you used in
scanf
is wrong: Change fromQuote:
scanf("%f",&width);
to
scanf("%lf",&width);
See scanf - C++ Reference[^] Of course you need to make modify the other
scanf
call as well.The c programming is the oriented language which will be going to proceed it for the user which will be going to work for implementing the part which will be more important to exaggerate it so hp support australia will guide you to make you understand the part for the valuable aspects which will keep the user enthusiastic for the work.