In: Computer Science
Fill in the blanks of the following segment of code, so that the output would be 1 3 4.
int count = 0;
do
{
++ count;
if (count == 2)
Blank;
cout << count << " ";
} while (count <= Blank);
cout << endl;
We need to skip 2 in output so we can use continue for that purpose. And to print upto 4 we can use ( while <= 3) condition.
C++ code :-
#include
using namespace std;
int main()
{
int count=0;
do{
++count;
if(count==2)
continue;
cout< }while(count<=3); cout< } Output :- 1 3 4