Electrical and Computer Engineering
12 of 23
UAH
CPE 112
Is This a Well-Formed Loop?
- No, So Fix It
•
•commaCount = 0;
•cin.get(inChar);
•
•while (inchar != ‘\n’)
•{
•    if (inChar == ‘,’)
•         commaCount++;
•    cin.get(inChar);
•}
•cout << commaCount << endl;
•