C语言入门经典

/* programe  which rember user to input width and length in inches,then output the square of the room in square yard */
#include<stdio.h>
#include<math.h>
int main(){
    long length = 0L ;
    long width = 0L ;
    long sqreinches = 0L ;
    float sqre = 0.0f;
    printf(" Please input the room's width:");
    scanf("%ld",&width);

    printf(" Please input the room's height:");
    scanf("%ld",&length);

     sqreinches = length * width ;
     sqre =  (float)sqreinches / 9 ;
     printf("the sqre is %.2f",sqre);
     return 0 ;
}

你可能感兴趣的:(C语言)