Created
June 10, 2018 15:53
-
-
Save piqueprajwal/479dd41b7460b035d75f6b4ae3b70daa to your computer and use it in GitHub Desktop.
programmingfaster.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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