Sunday, June 12, 2011

C++ : Between 3 Largest Numbers Determining Integer in C++

download

I. ALGORITHM

{Read three integers, determine the largest number among threenumbers and display it to screen}


DECLARATION

x, y, z: integer


DESCRIPTION
read (x, y, z)
if (x> y) and (x> z) then write ('The biggest number is = x)
else if (y> x) and (y> z) then write (the largest number is = y)
else write (the largest number is z)
end if

II. Source code in C + +

# include
# include

class appeal {
friend istream& operator >> ( istream&, vs& );
public:
appeal (){};
void compare () {
if ((x> y) & & (x> z))
cout <<"the largest number:" <else if ((y> x) & & (y> z))
cout <<"the largest number:" <else
cout <<"the largest number:" <}
private:
int x, y, z;
};

istream& operator>> (istream& in, appeals& number) {
cout <<"Numbers first =";
in>> bilangan.x;
cout <<"The second number =";
in>> bilangan.y;
cout <<"third number =";
in>> bilangan.z;
return ins;
}

int main () {
appeal number;
cin>> number;
bilangan.bandingkan ();

return 0;
}

download

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More