C program to read value and display surface area.

0
6
digitalample eye
Write a c program to read a and print the value and surface area.
C program to read value and display surface area.
Define int a and print the value of surface area in C programming.

If a cube has its side and its volume and surface area given by the formulae v = a3 and s=6a2. Write a program to read “a” and print the volume and surface area.

#include <stdio.h>
#include <conio.h>
void main()
{
int a,v,s;
clrscr();
printf("Enter the value of a:");
scanf("%d",&a);
v=a*a*a;
s=6*a*a;
printf("Volume=%dnSurface area=%d",v,s);
getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here