Is This a Well-Formed Loop?
commaCount = 1;
cin.get(inChar);
while
(inchar != ‘\n’)
{
if
(inChar == ‘,’)
commaCount++;
cin.get(inChar);
}
cout << commaCount << endl;