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 kind of jobs can I get with c++?

0 Answers  


what is the order of initialization for data?

10 Answers   Amazon, TCS, Wipro,


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

0 Answers  


What is flush c++?

0 Answers  


Is string data type in c++?

0 Answers  


What are default parameters? How are they evaluated in c++ function?

0 Answers  


Is python written in c or c++?

0 Answers  


What is the difference between Char a[ ]=”string” and char *a=”String”

11 Answers   Adobe,


What is the difference between c++ and turbo c++?

0 Answers  


What is a manipulator in c++?

0 Answers  


What is ofstream c++?

0 Answers  


How the virtual functions maintain the call up?

0 Answers  


Categories