English

Write a while loop that displays numbers 2, 4, 6, 8.......20.

Advertisements

Question

Write a while loop that displays numbers 2, 4, 6, 8.......20.

Short/Brief Note
Advertisements

Solution

While loop to
i = 2;
while(i<=20)
{
cout<< i <<“,”;
i = i+2;
}

shaalaa.com
Iteration Statements
  Is there an error in this question or solution?
Chapter 10: Flow of Control - Evaluation - Section - B [Page 178]
Advertisements
Share
Notifications



      Forgot password?
Use app×