Question: 4 - There is an error in the following C + + code: int counter = 0 ; do 1 counter + + ; while
There is an error in the following code:
int counter ;
do
counter ;
while counter
What is the type of this error? Choose the correct answer.
a syntax
b logical
How to fix this error? Choose the correct answer.
a add a semicolon ; after do
b use a for loop instead of a dowhile loop
c add a semicolon ; after the while condition
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
