63 074
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #39301 in C++ for ahmed

Question #39301
write a c++ program to generate and print out the alphabetic letter
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions