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 virtual base class uses?

0 Answers  


What is c++ 11 and c++ 14?

0 Answers  


What is function prototyping?

0 Answers  


Discuss the possibilities related to the termination of a program before entering the mainq method?

0 Answers  


List out some of the OODBMS available?

1 Answers  


Implement strncpy

3 Answers  


What is the purpose of ios::basefield in the following statement?

0 Answers  


What are the advantages and disadvantages of using inline and const?

2 Answers   Polaris, TCS, Zimmer Biomet,


Explain deep copy and a shallow copy?

0 Answers  


Write a program which uses Command Line Arguments

0 Answers  


What is abstract keyword in c++?

0 Answers  


Explain operator overloading.

0 Answers  


Categories