jman007_93
Member
- Joined
- Jan 7, 2008
- Sythe Gold
- 0
- Messages
- 63
hey ive only been doing C++ for a little while so dont criticize me or anything. well this is it. what it does is check to see if the number is valid or not. i think it is just bypassing most of the code. no matter what number is entered, it always returns "The number is not valid". please help me. thanx
#include <iostream>
using namespace std;
int main() {
int a; int b; int c; int d; int e; int f; int g; int h;
int i; int j; int k; int l; int m; int n; int o; int p;
cout << "Enter a number and press ENTER: ";
cin >> a;
cout << "Enter a number and press ENTER: ";
cin >> b;
cout << "Enter a number and press ENTER: ";
cin >> c;
cout << "Enter a number and press ENTER: ";
cin >> d;
cout << "Enter a number and press ENTER: ";
cin >> e;
cout << "Enter a number and press ENTER: ";
cin >> f;
cout << "Enter a number and press ENTER: ";
cin >> g;
cout << "Enter a number and press ENTER: ";
cin >> h;
cout << "Enter a number and press ENTER: ";
cin >> i;
cout << "Enter a number and press ENTER: ";
cin >> j;
cout << "Enter a number and press ENTER: ";
cin >> k;
cout << "Enter a number and press ENTER: ";
cin >> l;
cout << "Enter a number and press ENTER: ";
cin >> m;
cout << "Enter a number and press ENTER: ";
cin >> n;
cout << "Enter a number and press ENTER: ";
cin >> o;
cout << "Enter a number and press ENTER: ";
cin >> p;
if (a == 1)
a == 2;
if (a == 2)
a == 4;
if (a == 3)
a == 6;
if (a == 4)
a == 8;
if (a == 5)
a == 1;
if (a == 6)
a == 3;
if (a == 7)
a == 5;
if (a == 8)
a == 7;
if (a == 9)
a == 9;
if (a == 0)
a == 0;
if (c == 1)
c == 2;
if (c == 2)
c == 4;
if (c == 3)
c == 6;
if (c == 4)
c == 8;
if (c == 5)
c == 1;
if (c == 6)
c == 3;
if (c == 7)
c == 5;
if (c == 8)
c == 7;
if (c == 9)
c == 9;
if (c == 0)
c == 0;
if (e == 1)
e == 2;
if (e == 2)
e == 4;
if (e == 3)
e == 6;
if (e == 4)
e == 8;
if (e == 5)
e == 1;
if (e == 6)
e == 3;
if (e == 7)
e == 5;
if (e == 8)
e == 7;
if (e == 9)
e == 9;
if (e == 0)
e == 0;
if (g == 1)
g == 2;
if (g == 2)
g == 4;
if (g == 3)
g == 6;
if (g == 4)
g == 8;
if (g == 5)
g == 1;
if (g == 6)
g == 3;
if (g == 7)
g == 5;
if (g == 8)
g == 7;
if (g == 9)
g == 9;
if (g == 0)
g == 0;
if (i == 1)
i == 2;
if (i == 2)
i == 4;
if (i == 3)
i == 6;
if (i == 4)
i == 8;
if (i == 5)
i == 1;
if (i == 6)
i == 3;
if (i == 7)
i == 5;
if (i == 8)
i == 7;
if (i == 9)
i == 9;
if (i == 0)
i == 0;
if (k == 1)
k == 2;
if (k == 2)
k == 4;
if (k == 3)
k == 6;
if (k == 4)
k == 8;
if (k == 5)
k == 1;
if (k == 6)
k == 3;
if (k == 7)
k == 5;
if (k == 8)
k == 7;
if (k == 9)
k == 9;
if (k == 0)
k == 0;
if (m == 1)
m == 2;
if (m == 2)
m == 4;
if (m == 3)
m == 6;
if (m == 4)
m == 8;
if (m == 5)
m == 1;
if (m == 6)
m == 3;
if (m == 7)
m == 5;
if (m == 8)
m == 7;
if (m == 9)
m == 9;
if (m == 0)
m == 0;
if (o == 1)
o == 2;
if (o == 2)
o == 4;
if (o == 3)
o == 6;
if (o == 4)
o == 8;
if (o == 5)
o == 1;
if (o == 6)
o == 3;
if (o == 7)
o == 5;
if (o == 8)
o == 7;
if (o == 9)
o == 9;
if (o == 0)
o == 0;
if (a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p % 10 == 0)
cout << "The number is valid";
else
cout << "The number is not valid";
return 0;
}




