1. Home
  2. /
  3. Blog
  4. /
  5. rand in c++
C++

rand in c++

October 1, 2022 1 min read 2,229
rand in c++
#include <iostream>
using namespace std;
int main()
{

   //   1+(rand()%10)
cout<< 1+(rand()%10) <<endl;
for (int i=1;i<=5;i++)
{
cout<<1+(rand()%10)<<endl;
}

}
Share:
Read next

Related articles