Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how can we create 4 digit random number in c++

#include<time.h>

int number;

number=rand()%1000;
srand ( time(NULL) );
Comment

how can we create 4 digit random number in c++

number = rand() %1000;
Comment

PREVIOUS NEXT
Code Example
Cpp :: struct c++ 
Cpp :: cpp string find all occurence 
Cpp :: c++ if example 
Cpp :: position of max element in vector c++ 
Cpp :: c++ random generator 
Cpp :: mac emoji shortcut 
Cpp :: quicksort 
Cpp :: C++ Increment and Decrement 
Cpp :: check if a key is in map c++ 
Cpp :: c++ switch statement 
Cpp :: ++ how to write quotation mark in a string 
Cpp :: maxheap cpp stl 
Cpp :: cpp #include "" < 
Cpp :: rotate an array of n elements to the right by k steps 
Cpp :: read string with spaces in c++ 
Cpp :: heap buffer overflow in c 
Cpp :: variables in c++ 
Cpp :: c++ forbids comparison between pointer and integer 
Cpp :: find positive number factorial in C++ 
Cpp :: C++ fibo 
Cpp :: heredar constructor c++ 
Cpp :: c++ unittest in ros 
Cpp :: vector::at() || Finding element with given position using vector in C++ 
Cpp :: c++ add input in 
Cpp :: declare empty array in c++ 
Cpp :: shortest path in unweighted graph bfs 
Cpp :: copy assignment operator in c++ 
Cpp :: concatenate string in cpp 
Cpp :: how to create a struct in c++ 
Cpp :: c++ main function parameters 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =