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
Name at least TWO kinds of gaming experiences that are possible with these new control devices but were not possible on original joysticks.
Answers (1)
Which statement about muzzleloaders is true? All muzzleloaders are rifles. All muzzleloaders have only one barrel. Muzzleloaders are safer and easier to use than modern firearms. Muzzleloaders are early firearms that are loaded from the open end.
Answers (1)
A client PC on your company's network is attempting to browse to a vendor's web page on the Internet, but the computer goes to a malicious web page instead. What two utilities can you use to verify that the DNS records are correct for the web page?
Answers (1)
In cell J4, calculate the Actual Increase/Decrease from the first quarter to the second quarter. Subtract the First Quarter value (H4) from the second quarter Total (F4), and then divide that result by the First Quarter value.
Answers (1)
After reading the article, "The Impact of Technology", answer the following question. Why is technology seen as "a social obstacle
Answers (1)
New Questions in Computers & Technology
A predictive data analyst ___ A.) Creates data and trends B.) Creates data and infers trends C.) Analyzes data and predicts trends D.) Analyzes data and trends and predicts future data and trends
Answers (1)
A university begins Year 1 with 80 faculty. They hire 4 faculty each year. During each year 10% (rounded to the nearest integer) of the faculty present at the beginning of the year leave the university.
Answers (1)
Which of the following would a typical e-commerce website not include? blog customer comments employee salaries retail store information
Answers (1)
What is the difference between a rendering engine and a browser engine?
Answers (1)
Write a program to calculate the area of a triangle whose base is 10cm and height is 6cm
Answers (1)
Home
»
Computers & Technology
» How would you print from 1 to 1000
Sign In
Sign Up
Forgot Password?