Answer to Question #39301 in C++ for ahmed
write a c++ program to generate and print out the alphabetic letter
1
2014-03-04T10:13:21-0500
#include <iostream>
#include <time.h>
using namespace std;
char generateLetter()
{
return 'a' + rand() % 26;
}
int main (void)
{
srand((unsigned int)time(0));
char letter = generateLetter();
cout << "Generated letter: " << letter
<< endl;
}
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
C++
Comments
Leave a comment