Sign In
Ask Question
Guest
Computers & Technology
7 April, 04:07
How would you print from 1 to 1000
+5
Answers (
1
)
Daniel Whitney
7 April, 04:23
0
There are two ways to print 1 to 1000
Using Loops. Using Recursion.
Explanation:
Using loops
for (int i=1; i<=1000; i++)
{
cout<
}
Using recursion
Remember you can implement recursion using a function only.
void print (int n)
{
if (n==0)
return;
print (n-1);
cout<
}
you should pass 1000 as an argument to the function print.
Comment
Complaint
Link
Know the Answer?
Answer
Not Sure About the Answer?
Find an answer to your question 👍
“How would you print from 1 to 1000 ...”
in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers
You Might be Interested in
What is the printout of the following switch statement? char ch = 'a'; switch (ch) { case 'a': case 'A': cout << ch << endl; break; case 'b': case 'B': cout << ch << endl; break; case 'c': case 'C': cout << ch << endl; break;
Answers (1)
Write a main program that prompts users for 5 integers. Use two separate functions to return (NOT print) the highest and lowest value of the 5 integers. From main, display all five numbers entered and the results.
Answers (1)
Many application controls are useful for enhancing the reliability of both transaction data and master record data.
Answers (1)
Changing the user name in the word application is completed through the __. Home tab New Comment icon Word options menu View tab
Answers (1)
Write a loop to print 10 to 90 inclusive (this means it should include both the 10 and 90), 10 per line.
Answers (1)
New Questions in Computers & Technology
System is one in which you duplicate functions in order to improve the reliability and availability of a system.
Answers (1)
How many spaces should you use for an indent?
Answers (1)
A working model of a new product for testing purposes.
Answers (1)
Two variables, x and y, supposedly hold strings of digits. Write code that converts these to integers and assigns a variable z the sum of these two integers.
Answers (1)
1. How is Cyber Bullying different from bullying in person? 2. What could you do about stopping Cyber Bullying?
Answers (2)
Home
»
Computers & Technology
» How would you print from 1 to 1000
Sign In
Sign Up
Forgot Password?