Write a C++ Program to Generate Random Numbers between 0 and 100
Solution:
/* C++ Program to Generate Random Numbers between 0 and 100 */
#include<iostream>
#include<stdlib.h>
using namespace std;
int main()
{
int i; //loop counter
int num; //store random number
cout<<"Generating Random Numbers Below ::
";
for(i=1;i<=10;i++)
{
num=rand()%100; //get random number
cout<<" "<<num<<" ";
}
cout<<"
";
return 0;
}
Output:
/* C++ Program to Generate Random Number between 0 and 100 */
Generating Random Numbers Below ::
41 67 34 0 69 24 78 58 62 64
Process returned 0
| Is This Answer Correct ? | 0 Yes | 0 No |
What is c++ prototype?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
What is the benefit of c++?
When a function is made inline. Write the situation where inline functions may not work.
What is the main use of c++?
Array base access faster or pointer base access is faster?
Explain terminate() and unexpected() function?
What is the stack?
What is the difference between method and message?
Is there any difference between dlearations int* x and int *x? If so tell me the difference?
What is iomanip c++?
Write a program which employs Recursion