Programming

C Program to Read Value and Display Surface Area.

Define int and print the value of the 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();
}

Tuts

About Author

Tutsmaster.org provides tutorials related to tech and programmings. We are also setting up a community for the users and students.