There is a function that generate random number, it can be better than asking childish question XD.
Look at this program I made for you, it generates random letters
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
//Random numbers
#include <iostream>
#include <ctime> // For the use of random number
using namespace std;
void main (void)
{
char Random_Letter;
int Random_Number;
int Random_Inferior_Boundary = 65; // ASCII table capital letters start
int Random_Superior_Boundary = 90; // ASCII table capital letters end
srand( (unsigned) time(NULL)); // This set the random function with the computer's clock
Random_Number = (rand() % ((Random_Superior_Boundary + 1) - Random_Inferior_Boundary) + Random_Inferior_Boundary);
Random_Letter = Random_Number;
cout << Random_Letter << endl;
system("pause");
}
|
otherwise
int letter1, letter2, letter3, letter4;
and should be with
short age;
int brain_wt; // It should be Brain_Weight at least, its better.
bool glue;
int K= (26*65*32);
For good programming practice.
It looks like an disguised homework to do, it's kind of weird.
<< static_cast<char>(letter4);
here your << goes out and I don't understand.
instead of calling the static_cast<char>(letter4) you can do: (char) letter4, only when you need it to be a char
What is that K value?
Tell me if you need more help