Computer Science, asked by adityabhadani0905200, 5 months ago

Q2. Convert the following for loop to corresponding while loop:
for(int x=1,s=0; x<=25; x+=2)
S+=X,​ and quick

Answers

Answered by BrainlyProgrammer
1

\huge\star\underbrace{\mathtt\red{⫷❥ᴀ᭄} \mathtt\green{n~ }\mathtt\blue{ §} \mathtt\purple{₩}\mathtt\orange{Σ} \mathtt\pink{R⫸}}\star

int x=1,s=0;

while(x<=25)

{

s+=x;

x+=2;

}

Answered by anindyaadhikari13
2

Question:-

➡ Convert the following for loop to while loop.

Solution:-

This is the converted code snippet.

int x=1,s=0;

while(x<=25)

{

s+=x;

x+=2;

}

Similar questions