// Code derived from Stroustrup's PPP2 book// § 10.7 Reading a single value// -and beginning on p 358#include<iostream>usingnamespacestd;intmain(){cout<<"Please enter an integer in the range 1 to 10 (inclusive):\n";intn=0;while(cin>>n){// readif(1<=n&&n<=10)// check rangebreak;// exit while() loop when a good value is obtainedcout<<"Sorry "<<n<<" is not in the [1:10] range; please try again\n";}// what could possibly go wrong here?// … use n here …}