60 370
Assignments Done
98,1%
Successfully Done
In April 2018

Answer to Question #27331 in C++ for red rose

Question #27331
Write a program using a while loop to print the numbers 2 to 10 in increments of two. The output of your program should be

2 4 6 8 10
Expert's answer
#include <iostream>
using namespace std;

int main()
{
// initial value
int num = 2;
while (num<=10)
{
// print current number and space
cout<<num<<" ";
// increase the number by 2
num += 2;
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions