#include<iostream.h>
#include<conio.h>
int count(int a[],int n)
{
int count=0,i;
for(i=0;i<n;i++)
{
if(a[i]>5)
{
count++;
}
}
return(count);
}
void main()
{
clrscr();
int a[10],n,i;
cout<<"enter size";
cout<<"\n\n";
cin>>n;
cout<<"\n\n";
cout<<"enter elements";
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\n";
cin>>a[i];
}
cout<<"\n\n";
cout<<"nos. greater than 5 are"<<"\t"<<count(a,n);
getch();
}
#include<conio.h>
int count(int a[],int n)
{
int count=0,i;
for(i=0;i<n;i++)
{
if(a[i]>5)
{
count++;
}
}
return(count);
}
void main()
{
clrscr();
int a[10],n,i;
cout<<"enter size";
cout<<"\n\n";
cin>>n;
cout<<"\n\n";
cout<<"enter elements";
cout<<"\n\n";
for(i=0;i<n;i++)
{
cout<<"\n";
cin>>a[i];
}
cout<<"\n\n";
cout<<"nos. greater than 5 are"<<"\t"<<count(a,n);
getch();
}