Write a while loop that prints all positive numbers that are divisible by 10 and less than a given number n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90. loop.cpp 1. 2 #include 4 using namespace std; 5 6 int main() { cout « "n: " « endl: int n; | cin >> n; 10 11 .. while (...) { 12 13 14 ... 15 cout << ... « " "; 16 17 cout <« endl; 18 19 return 0; 20 CodeCheck Reset

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

Please help in C++

Write a while loop that prints all positive numbers that are divisible by 10 and less than a given number n. For example, if n is 100, print 10 20 30 40 50 60 70 80
90.
loop.cpp
#include <iostream>
using namespace std;
int main()
{
cout <« "n: " « endl;
int n; |
cin >> n;
while (...)
{
...
cout << ... « ";
}
cout « endl;
19
return 0;
}
20
CodeCheck
Reset
Transcribed Image Text:Write a while loop that prints all positive numbers that are divisible by 10 and less than a given number n. For example, if n is 100, print 10 20 30 40 50 60 70 80 90. loop.cpp #include <iostream> using namespace std; int main() { cout <« "n: " « endl; int n; | cin >> n; while (...) { ... cout << ... « "; } cout « endl; 19 return 0; } 20 CodeCheck Reset
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning