Thursday, 24 January 2013

array highest number

#include <iostream>

using namespace std;

int main()
{
   int y;
cout << "how many values";
   cin >> y;
   int x[y];
   for(int i=0; i<y;i++)
   {
       cin >> x[i];

       if(x[0]<x[i])
       {
           x[0]=x[i];
       }
   }cout << x[0];



    return 0;
}

0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Enterprise Project Management