how to make a generator which generates codes for eg;-123456?? how to make this i need
serious help thanks in advance for everyone who helped me.

dusktreader commented: Take the time to fully explain your problem +0

Recommended Answers

All 2 Replies

I think you are looking for random number generator. Here is an example :

#include <iostream>
#include <ctime>

int main(){
 srand(time(0)); //seed random number generator

 for(int i = 0; i < 5; i++){
    for(int j = 0; j < 5; ++j){
        int randomNumber = rand(); //use rand() function to return a random number
        cout << randomNumber << " ";
     }
    cout << endl;
 }

 return 0;
}

hey firstPerson this is not the code i want i will tellu an exaMPLE see

i gave c++ this info that if i gave three codes 1,2 or 3 and i tell c++ that i want

to output on the screen any one of these three digits. thanks anyway for helping

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.