C program to read value and display surface area.

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.

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=%d\nSurface area=%d",v,s);
 getch();
}

You May Also Like...

Socialize with Us