Join 137,260 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,549 people online right now. Registration is fast and FREE... Join Now!
I need to make a function that outputs y and n randomnly using rand(). The only info i can find for using rand() is with numbers. not characters. any help please?
That is because the rand function only returns a number. What you need to do is randomly pick a number between 1 and 2. If 1 is picked then output the letter 'y', if 2 is the number picked then output the letter 'n'.