Wednesday, 20 February 2013

A program to print a maximum value in array


#include<iostream.h>
using namespace std;
main( )
{
float  abc[10], max;
int i;
for(i=0;i<=9;i++)
{
cout<<"enter values";
cin>>abc[i];
}
max=abc[0];
for(i=1;i<9;i++)
{
if(max<abc[i] )
max=abc[i];
}
cout<<max;
}

No comments:

Post a Comment