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

Explain abstraction.

0 Answers  


How are virtual functions implemented in c++?

0 Answers  


How does c++ sort work?

0 Answers  


Why do we need c++?

0 Answers  


Explain stack unwinding.

0 Answers  


Do the parentheses after the type name make a difference with new?

0 Answers  


What is low level language in simple words?

0 Answers  


What are c++ templates used for?

0 Answers  


Can you please explain the difference between overloading and overriding?

0 Answers  


What is an orthogonal base class in c++?

0 Answers  


What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h

0 Answers  


Carry out conversion of one object of user-defined type to another?

0 Answers  


Categories