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

Explain linked list using c++ with an example?

1132


What parameter does the constructor to an ofstream object take?

1104


Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?

4168


Are there interfaces in c++?

1063


Write syntax to define friend functions in C++.

1120


How much do c++ programmers make?

1159


What is the equivalent of Pascal's Real a) unsigned int b) float c) char

1056


What is the two main roles of operating system?

1119


When should I use unitbuf flag?

1066


What is the difference between strcpy() and strncpy()?

1192


Which is the best c++ compiler?

1127


What is a far pointer? where we use it?

1126


Write a program to concatenate two strings.

1141


What does new return if there is insufficient memory to make your new object?

1082


What is the use of volatile variable?

1158