Random number generator using C++
#include<iostream> #include<time.h> #include<stdlib.h> #define MAX_NUM 10 using namespace std; void randnum() { int random; srand(time(NULL)); for(int i=0;i<10;i++) { random=rand()%MAX_NUM; cout<<random<<endl; } } int main() { cout<<"The ten random number are "<<endl; randnum(); return 0; } /* OUTPUT The ten random number are 3 0 8 9 6 4 8 8 8 0 */
Different ways the Above question can be asked
- Random number generator – C++
- C++ Random Numbers
- random function in c++
- program to generate random numbers for a given range
- C++ Random number generator
- C++ Random Number Generator
- Random number generator, C++
- C++ – Random Number Generator
- Generating Random Numbers in C and C++
- Searches related to Generate random number in C++
- generate random number C++
- visual c++ generate random number
- c++ generate uniform random number
- c++ random number range
- cpp random
- C++ Simple Programs And Examples
- C++ – Hello World Program
- C++ – Simple calculator
- C++ – Even and Odd
- C++ – Swap two numbers
- C++ – Prime Number
- C++ – Find Perfect Number
- C++ – Factorial of Number
- C++ – Fibonacci Series
- C++ – Human Resource Management Program
- C++ – Calculate number of characters, words, sentences
- C++ – Subtract two Strings
- C++ – Processing of the Students structure
- C++ – Program with Matrices
- C++ – Calculate Equation
- C++ – Arrange Numbers in Ascending order
- C++ – Check Armstrong Number
- C++ – HCF and LCM
- C++ – Square Root of a Number
- C++ – Cube Root of a Number
- C++ – ASCII Code for Characters and numbers
- C++ – Check Palindrome Number
- C++ – Bubble sort
- C++ – Random Number Generator
- C++ – Sum of ODD Numbers in the Given Range
- C++ – Display current date and time
- Formula Based Programs
- C++ – Leap Year
- C++ – Surface Area and volume of cone
- C++ – Solve Quadratic equation
- String Based Programs
- C++ – String into Upper case or lower case
- C++ – Concatenate Strings
- Array Based Programs
- C++ – Program with Matrices
- Print Any Patterns
- C++ – Print 5 rows of 10 Stars (*)
- C++ – Half Pyramid of Stars (*)
- C++ – Half Pyramid of numbers
- C++ – Print Triangle of Stars
- C++ – Display Reverse pyramid.
- C++ – Print Alphabet Pattern
- C++ – Diamond of Star
- C++ – Pascal Triangle
- C++ – Floyd Triangle
- C++ Conversion
- C++ – Convert decimal to Hexadecimal
- C++ – Decimal to Binary
- C++ Sorting algorithms & Techniques
- C++ – Bubble Sort
- C++ – Insertion Sort
- C++ – Selection Sort
- C++ – Merge Sort
- C++ – Quick Sort
- C++ Handling Files
- C++ – How to get Current Directory in Linux/Windows
- C++ – How Create a Text File and Write in It
Leave a Reply