Get Max Number In 5 Numbers Given By User (Greater Number)
if(n[i]>max)
max=n[i];
Code Is Give Blow
Click On Read More
#include<iostream>
using namespace std;
int main()
{
int n[5],max=1;
for(int i=0; i<=5; i++)
{
cout<<"Enter The Value=";
cin>>n[i];
}
for(int i=0; i<=5; i++)
{
if(n[i]>max)
max=n[i];
}
cout<<"Maximium ="<<max;
}
No comments:
Post a Comment