Output |
using namespace std;
int main()
{
int z,n,a[100];
cout<<"Enter no. of values: ";
cin>>n;
cout<<"Enter "<<n<<" values: ";
for(int x=0;x<n;x++)
{
cin>>a[x];
}
z=a[0];
for(int x=1;x<n;x++)
{
if(z<a[x]) {
z=a[x];
}
}
cout<<"Largest: "<<z<<"\n";
}
A blog to help students to learn programming in various languages including C, C++, Java, Python and many more.
Output |
0 comments :
Post a Comment