Hello, I'm trying to write a conditional IF statement for my program. What it's supposed to do is allow the user to enter numbers at random, but it cannot repeat any numbers.
#include <iostream>
using namespace std;
void main()
{
int a;
int b;
int c;
int d;
int e;
int f;
int g;
cout << "Enter Fist Number: ";
cin >> a;
//cout << a << "\n";
cout << "Enter Second Number: ";
cin >> b;
//cout << a << "\n";
cout << "Enter Next Number: ";
cin >> c;
//cout << a << "\n";
cout << "Enter Next Number: ";
cin >> d;
//cout << a << "\n";
cout << "Enter Next Number: ";
cin >> e;
//cout << a << "\n";
cout << "Enter Next Number: ";
cin >> f;
//cout << a << "\n";
cout << "Enter Next Number: ";
cin >> g;
//cout << a << "\n";
if (a=b=c=d=e=f=g)
{
"Cannot Enter Same Numbers! ";
}
}
Can someone please help me figure out how to do this. Thank you.
-Mike