Powered by Blogger.

Saturday, January 19, 2013

Surface Area Of Rectangle

#include<iostream.h>
#include<conio.h>
void surface(int x, int y, int z=5);
void volume(int x,int y, int z=5);
void volume(int r);
#include<math.h>
void main()
{
clrscr();
float l,b,h;
cout<<"enter the length breadth and height of the rectangle\n";
cin>>l>>b>>h;
surface(l,b,h);
volume(l,b,h);

cout<<"enter the length and breadth of rectangle";

cin>>l>>b;
surface(l,b);
volume(l,b);
cout<<"enter the radius of rectangle";
cin>>l  ;
volume(l);
getch();
}
void surface(int x,int y ,int z)
{
       int surface=2*((x*y)+(x*z)+(y*z));

cout<<"surface area of rectangle is:"<<surface<<endl;
}
void volume(int x,int y,int z)
{        int volume;
     volume=x*y*z;

    cout<<"volume of rectangle is:"<<volume<<endl;
}
void volume(int r)
{
    int volume=(((4/3)*3.14)*pow(r,3));
    cout<<"volume of sphere"<<volume<<endl;
    }

0 comments:

Post a Comment