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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a nested class.

1072


When you overload member functions, in what ways must they differ?

1038


Is it possible to get the source code back from binary file?

1352


What flag means?

950


what is oops and list its features in c++?

1053


What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?

1045


How do I use arrays in c++?

998


How do you generate a random number in c++?

1088


Is dev c++ a good compiler?

958


What is stream and its types in c++?

1047


Explain virtual class?

1024


How is computer programming useful in real life?

1054


What is lvalue?

1169


Can you be able to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?

1101


What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?

1167