I'm trying to run this program whereas if i input the same number previously, it would terminate. I can't figure it out. Can anyone tell me where i went wrong or missed? I'm just starting the basics of C++ so feel free to criticize my newb code :)
#include <iostream>
usingnamespace std;
int main()
{
int x = 1; // for increments. Starts counting at 1.
int y = 0; // for starting inputs
while(x>0)
{
restart:
cout << "Input a number other than " << y << " : ";
cin >> y;
int a;
a = y;
if (a=y)
goto restart;
elsebreak;
x++;
}
return 0;
}