Program of Finding greater and Occurrence of num in Array
#include<iostream.h>#include<string.h>
using namespace std ;
int main ()
{
cout<<" Program of Finding greater and Occurence of num in Array"<<endl<<endl;
int a[10],b,m,c=0;
cout<<"Enter number "<<endl<<endl;
for(b=0;b<=10;b++)
{
cin>>a[b];
}
m=a[0];
for(b=0;b<=10;b++)
{
if(a[b]>=m)
m=a[b];
else
m=m;
}
for(b=0;b<=10;b++)
{
if(a[b]==m)
{
c++;
}
}
cout<<"Your Greater num is ("<<m<<") And it occurs ("<<c<<") time"<<endl;
}
<<<<<<<< >>>>>>>>
0 comments:
Post a Comment