infinite looping when 2 large integers divide
relatively new to c++ and to the forum. wrote a program that divides two integers:
Code:
int main()
{
unsigned long a, b, c;
do
{
cout << "\n\nEnter a and b respectively.\n";
cin >> a; cin >> b;
cout << "a/b= " << (double) a/b << "\n";
cout << "Continue? 1=yes, 0=no\n";
cin >> c;
}while(c);
return 0;
}
i understand that a digit that is more than 10 digits long cannot be fed into a or b. But what I don't understand is why would the program loop infinitely without pausing for an input in c when a huge number is entered (besides c doesn't have a value for while to respond). have search the faqs and threads but couldn't find what i wanted.