Computer Science, asked by SMD2004, 4 months ago

Convert the following for loop into while loop:

for k in range (10,20,5):

print(k)​

Answers

Answered by wollow
4

Answer:

;-;

Explanation:

a=10

while a<20:

print (a)

a+=5

Answered by Berseria
10

Question :

To Convert the following for loop into while loop.

Given For Loop :

for k in range (10,20,5):

print(k)

Solution :

In While Loop :

#include <iostream>

using namespace std;

int main ( )

{

int a ;

k = 10

while k<20 ;

Print ( k )

k + = 5

}

Syntax of for Loop Statement :

for( initialisation ; condition ; updation )

{

< Statement ( s ) >

}

Syntax of While Loop Statement :

while ( <expression> )

{

< Statement (s) >

}


Anonymous: Perfect answer :D
Similar questions