101
{ USER }
posts: 55
last: 09-Apr-2008
TITLE: Area overloded algorithm
DESCRIPTION: Area overloded algorithm
Submitted: 09-Apr-2008 09:43:32 ( 38w 5d 23h ago ) Language: C++ (*.cpp *.h)
Views: 84 Lines of Code: 45 LINES
Rating:
rate: star1
star2
star3
star4
star5
dstar1
dstar2
dstar3
dstar4
dstar5  ( rated! )
  { 0.00 / 5 }
Difficulty: Intermediate
Bookmark
/* Author: 101
   Date: 09-04-2008
   Filename: 
   Description: Area overloded
   History: 
*/


#include<iostream.h>
#include<conio.h>
#define phi  3.14
int area(int,int);
float area(int);
void main()
{
	int a,b,c,cho;
	clrscr();
	cout<<"\t  What do you want to do?\n";
	cout<<"1. area of rectangle"<<endl;
	cout<<"2. area of circle"<<endl;
	cout<<"Choice:";
	cin>>cho;
	switch(cho)
	{
		case 1:
			cout<<"Enter lengt and breath (with white space):";
			cin>>a>>b;
			cout<<"Area of RECTANGLE:"<<area(a,b);
			break;
		case 2:
			cout<<"Enter radius:";
			cin>>c;
			cout<<"Area of CIRCLE:"<<area(c);
			break;
	  }
	getch();
  }
 int area(int x,int y)
  {
  return (x*y);
 }
 float area(int s)
 {
 return (phi*s*s);
 }