Insert the missing condition in the following code fragment. The code is intended to compute the product of several integers entered by the user. The loop should stop when the user enters something other than an integer.
int product = 1;
int value;
cin >> value; while (______ )
{
product = product * value;
cin >> value;
}
while (typeid(value).name()==typeid(int).name())
This also requires #include <typeinfo> before int main().
Comments
Leave a comment