Me and my friend need to make a license plate generator program as a final project for our c++ class. We're trying to make it so it outputs 6 random numbers and letters. I'm gonna try to make it pick 6 random numbers between 0 and 35. If it is a number between 0 and 9, it will show up as that number and if it is between 10 and 35, it will show up as a letter (10=A, 11=B, 35=Z). We can make it generate a number between 0 and 35, but don't know how to make it assign letters to the numbers it generates. So could anybody tell me how you would do that?
arrr matey
0
Newbie Poster
Recommended Answers
Jump to Post#include <stdio.h> #include <stdlib.h> #include <time.h> int main ( void ) { static const char value[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; int i; srand ( time ( 0 ) ); for ( i = 0; i < 6; ++i ) { putchar ( value [ rand() % ( sizeof value …
All 3 Replies
Dave Sinkula
2,398
long time no c
Team Colleague
jwenting
1,889
duckman
Team Colleague
arrr matey
0
Newbie Poster
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.