Updating code

I'm having trouble updating this code to a modern compiler, it keeps giving me an error! saying "convo.h" file not found!



Code:


#include <iostream.h>
#include <conio.h>
int main()
{
int arr[50], freq[50];
int n, i, j, count;
clrscr();
cout<<"Enter n: ";
cin>>n;
while(n>19)
{
cout<<"enter size less than 20";
cin>>n;
}
cout<<"Enter elements in array: ";
for(i=0; i<n; i++)
{
cin>>arr[i];
while(arr[i]>50 || arr[i]< 0)
{
cout<<"number between 0 to 50";
cin>>arr[i];
}
freq[i] = -1;
}
// Counts frequency of each element
for(i=0; i<n; i++)
{
count = 1;
for(j=i+1; j<n; j++)
{
if(arr[i]==arr[j])
{
count++;
freq[j] = 0;
}
}

if(freq[i]!=0)
{
freq[i] = count;
}
}

// display results
cout<<"\nFrequency of all elements of array : \n";
for(i=0; i<n; i++)
{
if(freq[i]!=0)
{
cout<<"number\t"<<arr[i]<<"\t :"<<freq[i]<<" times\n";
}
}
getch();
return 0;
}
What compiler and operating system are you using? The conio.h header file is not a standard header file and may not be available with your compiler.


Please use code tags when posting code.

Topic archived. No new replies allowed.