Simple help. Breaking up "abc"
Well its been the whole summer since I have programmed and I'm a little rusty. Also, my CS teacher from last semester did not teach me this, and my CS teacher this semester already expects me to know it.
I simply need the equation to get 'b' out of 'abc'
Code:
#include <iostream>
using namespace std;
int main()
{
int abc, a, b, c;
cout << "Cameron Burton - CS 1362 - Lab 2" << endl;
for(abc=100;abc<=999;abc++)
{
a=abc/100;
b=?????;
c=abc%10;
if(a+b+c == abc)
{
cout << abc << endl;
}
}
return 0;
}