A blog to help students to learn programming in various languages including C, C++, Java, Python and many more.

Subscribe For Free Latest Updates!

We'll not spam mate! We promise.

Sunday 17 January 2016



Program ScreenShot
Output

#include <iostream>

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";
}


0 comments :

Post a Comment



Copyright © 2016 - ProgrmIt - All Rights Reserved
(Articles Cannot Be Reproduced Without Author Permission.)
Design By : | Powered By: Blogger