Tux Education Our New Education Channel Please Share And Subscribe It...

/* C Program To Find Out Surface Area & Volume Of A Cuboid */



// Compiler : Dev-C++ 4.9.9.2

#include<stdio.h>

int main()
{
    float w,l,h;
    float surface_area,volume,space_diagonal;

    printf("Width : ");
    scanf("%f",&w);
    printf("\n\nLength : ");
    scanf("%f",&l);
    printf("\n\nHeight : ");
    scanf("%f",&h);

    surface_area = 2*(w*l + l*h + h*w);
    volume = w * l * h;
    space_diagonal = sqrt(w*w + l*l + h*h);

    printf("\n\n\nSurface Area Of Cuboids Is : %.3f",surface_area);
    printf("\n\n\nVolume Of Cuboids Is : %.3f",volume);
    printf("\n\n\nSpace Diagonal Of Cuboids Is : %.3f",space_diagonal);
    
    getch();
    return 0;
}

Post a Comment