Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdlib.h>
- using namespace std;
- char intToAlphabet( int i )
- {
- return static_cast<char>('A' - 1 + i);
- }
- int main()
- {
- int n=0 , x;
- while(n<3)
- {
- x=rand() % 26 + 1;
- cout<<intToAlphabet(x);
- n=n+1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment