#include <iostream>
int main()
{
int i,n,m;
cout <<"Enter the total number \n";
cin >>n;
cout <<"The total number of array is \n"<<n;
for(i=1;i<=n;i++)
cin >>a[i];
cout <<"The entered array is \n";
for(i=1;i<=n;i++)
cout <<"\n"<<a[i];
m = a[1];
for(i=2;i<=n;i++)
{
if(m<a[i])
m = a[i];
}
cout <<"The largest number is \n"<< m;
return 0;
}
not helpful
ReplyDeleteGives an error when you compile saying that "unidentified symbol a" on the line
ReplyDeletecin>>a[i];
we must declare size of array
ReplyDeleteint i,n,m,a[20];
where a[20] is the size of a.It may depend on your required memory allocation.
C++ program to Find Largest Number among three numbers
ReplyDeleteThanks for this code, it's very simple and easy.
C++ program to Find Largest Number among three numbers
ReplyDeleteThanks for this code, it's very simple and easy.
Thanks it's very simple and clearable code
ReplyDelete