I need 5 T or F questions with the option to input the answer and then add the correction to answer if right or wrong.
i just need random questions!

I am thinking of going to school for computer programming and my FIL is a programmer.

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
int True;
int False;
{
if (userresponse != 'T' && userresponse != 'F')
	cout << " Cows have 7 stomachs"
	cin >> userresponse
else
cout << " You responded True " << endl;

I need 5 T or F questions with the option to input the answer and then add the correction to answer if right or wrong.
i just need random questions!

I am thinking of going to school for computer programming and my FIL is a programmer.

#include <iostream>
#include <conio.h>

using namespace std;

int main()
{
int True;
int False;
{
if (userresponse != 'T' && userresponse != 'F')
    cout << " Cows have 7 stomachs"
    cin >> userresponse
else
cout << " You responded True " << endl;

end quote.

you need to declare usserresponse and its better if you use brackets for if..else statments. its much neater and u dont need brackets before the if

Hey, a new programmer, welcome! I remember playing with code for the first time, and wondering why it would not compile :) Make sure that you include a semicolon after the cout and cin lines. You should also declare userresponse as a string before you use it:

char userresponse;

I recommend moving your cin line up too, so that the user can input text before your if statement checks the input. If you make those changes, and add a couple of bracket on the end:

}}

then your code should work fine.

By the way, one of the best ways to learn, is to look through some of the free online C++ tutorials. If you google C++ tutorial, a bunch of good ones will come up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.