Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a C++ Program to Generate Random Numbers between 0 and 100



Write a C++ Program to Generate Random Numbers between 0 and 100..

Answer / hr

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

Post New Answer

More C++ General Interview Questions

What is c++ prototype?

0 Answers  


Write a corrected statement in c++ so that the statement will work properly. x =+ 7;

2 Answers  


What is the benefit of c++?

0 Answers  


When a function is made inline. Write the situation where inline functions may not work.

2 Answers  


What is the main use of c++?

0 Answers  


Array base access faster or pointer base access is faster?

0 Answers  


Explain terminate() and unexpected() function?

0 Answers  


What is the stack?

5 Answers   IBM, ICICI,


What is the difference between method and message?

5 Answers   HP,


Is there any difference between dlearations int* x and int *x? If so tell me the difference?

16 Answers   Lason,


What is iomanip c++?

0 Answers  


Write a program which employs Recursion

0 Answers  


Categories