#include <iostream>
#include <ctime>
using namespace std;
int main ()
{
int i,j;
srand ( (unsigned)time( NULL ) );
//Display 10 random numbers
for ( i = 0;i < 10;i++)
{
j= rand() %1000;
cout << j << endl;
}
system ("pause");
return 0;
}
///////This is my code but can't get the percentage of the odd ones///////////
It is obvious that you should count total of numbers and how many among then there are odd ones. As total is known (it is equal to 10 ) then you need count only odd ones.
For example
I think you should check that everywhere in the code there is :: and not :; or ;; or :;
Or remove everywhere the namespace prefix std:: because there is already directive using namespace std;