Answer to Question #185981 in C++ for shuvo

Question #185981

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;

}


1
Expert's answer
2021-05-01T14:11:39-0400
while (typeid(value).name()==typeid(int).name()) 

This also requires #include <typeinfo> before int main().


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS