Computer Science, asked by gargarpit356866, 10 months ago

Write an appropriate for loop to be repeated 100 times, except the loop is to be terminated

if the value of the variable p becomes 50.​

Answers

Answered by akshayamca14
7

Answer:

for can achieve it better

Explanation:

for (int i=1;i=100;i++){

if(i==50){

break;

}

}

Answered by nidaeamann
7

Explanation:

There are many ways and languages to write the desired program. One of the common languages is the C language and below program is written in C;

Program

void main () :

int p = 0;

while (not p == 100)

{

    if ( p == 50 ):

                  done = true;

               break

               else:

    p= p + 1;

}

return

Similar questions