Sign In
Ask Question
Computers & Technology
Hunter Farley
16 July, 06:27
How would you print from 1 to 1000
+2
Answers (
1
)
Nathanial Rich
16 July, 06:59
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?
Get an answer to your question ✅
“How would you print from 1 to 1000 ...”
in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers
You Might be Interested in
What security counter measures could be used to monitor your production SQL databases against injection attacks?
Answers (1)
How do you know if you have a high speed usb port?
Answers (1)
Buying a new pair of sunglasses for which of these reasons is most likely a sound financial decision? A: you have some extra money to burn B: The sun is hurting your eyes C: you want to impress your classmates D: The display in the store window is
Answers (1)
What is the name of the keyboard developed in the 1930s?
Answers (1)
Write an expression that computes the remainder of the variable principal when divided by the variable divisor. (Assume that each is associated with an int.)
Answers (1)
New Questions in Computers & Technology
What is the name of a coding sequence that is executed multiple times in a program? a break a pass a loop a suite
Answers (1)
Accepted identifier for a variable in PHP except: Select one: a. $_Puihaha b. & Puihaha c. $Pui_haha d. $Puihaha
Answers (1)
which payment method protects you from the possible costs of spending more money than you have avaible
Answers (2)
Write a program that will predict the size of a population of organisms. The program should ask the user for the starting number of organisms, their average daily population increase (as a percentage, expressed as a fraction in decimal form: for
Answers (1)
Explain the modern ways of sourcing information
Answers (1)
Home
»
Computers & Technology
» How would you print from 1 to 1000
Sign In
Sign Up
Forgot Password?