‘C’ program to print surface area (surface area=2(lb+lh+bh) of cuboid.

C File =>


/* Write a ‘C’ program to accept three dimensions length (l), breadth(b)  and height(h) of a cuboid and print surface area (surface area=2(lb+lh+bh)*/

#include<stdio.h>

int main() 
{
       int l,b,h;
 
       printf("\n Enter length : ");
       scanf("%d",&l);
       printf("\n Enter breadth : ");
       scanf("%d",&b);
       printf("\n Enter height : ");
       scanf("%d",&h);
       printf("\n Surface Area of cuboid = %d",2*(l*b+l*h+b*h));

       return 0;
}

Comments

Popular posts from this blog

Write a program to allocate memory dynamically for n integers. Accept the elements and calculate their sum and average

C program to accept names of n cities and search for city named “Pune”.