Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@piqueprajwal
Created June 10, 2018 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piqueprajwal/479dd41b7460b035d75f6b4ae3b70daa to your computer and use it in GitHub Desktop.
Save piqueprajwal/479dd41b7460b035d75f6b4ae3b70daa to your computer and use it in GitHub Desktop.
programmingfaster.com
#include<iostream>
using namespace std;
int main()
{
int i, a, l, n;
cout<<"Enter total number of elements";
cin>>n;
cout<<"Enter first number";
cin>>a;
l = n;
for (i=1; i<= n -1 ; i++)
{
cout<<" Enter another number";
cin>>a;
if (a>l)
l=a;
}
cout<<"The largest number is"<<l;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment