Write a program to write the frequency of the number in an array of size 50 whose values are from 0 to 10.
#include<iostream.h>
int main(){
int freg[10],j=0;
for(int i=0;i<=10;++i){
cin>>freg[i];
if(freg[i]<=10 && freg[i]>=0){
j=j+1;
}
}
cout<<"frequence="<<j<<endl;
return 0;}
Comments
Leave a comment