1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
gtnhenbr [62]
3 years ago
13

How would you print from 1 to 1000

Computers and Technology
1 answer:
Hitman42 [59]3 years ago
5 0

Answer:

There are two ways to print 1 to 1000

  1. Using Loops.
  2. Using Recursion.

Explanation:

Using loops

for(int i=1;i<=1000;i++)

{

  cout<<i<<" ";

}

Using recursion

Remember you can implement recursion using a function only.

void print(int n)

{

  if(n==0)

  return;

  print(n-1);

  cout<<n<<" "';

}

you should pass 1000 as an argument to the function print.

You might be interested in
In modern web design, color, font, font size, and style should be declared using:
inn [45]
They should be declared using style sheets (CSS).
5 0
3 years ago
Melissa is the network administrator for a small publishing company. as network administrator, she is in charge of maintaining t
Arte-miy333 [17]
The answer is an Intruder Prevention System (IPS). An Intrusion Detection System (IDS) will detect an attack but will not block it.
3 0
3 years ago
Create a set of functions that compute the mean, median, and mode of a set of
zepelin [54]

Refer to the attachment.

Language used=Python

5 0
2 years ago
Read 2 more answers
Complete the steps to evaluate the following
kirill115 [55]

Answer:

log base 3a= -0.631.log a/3 base 3

Now, -log m= log 1/m

hence,

log base 3a= 0.631.log 3/a base 3

log base 3a/log 3/a base 3 =0.631

log base 3 ( a.3/a) =.631 since, log m/logn =log n(m)

log base 3 3=0.631

Hence, answer is log base 3 3=0.631

Explanation:

Please check the answer section.

3 0
3 years ago
Read 2 more answers
Write a Java program that reads an 8-bit binary number from the keyboard as a string and then converts it into decimal. For exam
cestrela7 [59]

Answer:

public class Brainly

{

 public static void main(String[] args)

 {

   BinaryConverter conv = new BinaryConverter();

   String binStr = "01001101";

   System.out.print(binStr + " in decimal is "+conv.BinToDec(binStr));

 }

}

public class BinaryConverter

{

 public int BinToDec(String binStr)

 {

   int d = 0;

   while(binStr.length() > 0)

   {

     d = (d << 1) + ((binStr.charAt(0) == '1') ? 1: 0);

     binStr = binStr.substring(1);

   }

   return d;

 }

}

Explanation:

The program "eats" the string from left to right, and builds up the integer representation in variable "d" on the go. While there are digits left, it shifts the previous result to the left and sets the least signficant bit to 1 only if the corresponding string character is a 1.

5 0
3 years ago
Other questions:
  • Your company is implementing a wireless network and is concerned that someone from a competing company could stand outside the b
    14·1 answer
  • 50 pts DO NOT ANSWER FOR POINTS
    9·1 answer
  • Which searching method requires that the list be sorted?
    5·1 answer
  • I NEED IT FOR TODAY FOR KEYBOARDING TEST! GIVE ME CORRECT ANSWER PLZ!
    12·2 answers
  • If you tap or click the increase font size button too many times and make the font size too big, you can tap or click the _____
    9·1 answer
  • What command should be executed to view the configuration of the nic?
    7·1 answer
  • Why might a company choose Linux for its operating system instead of Microsoft Windows or Mac OS? The company's employees can sy
    13·1 answer
  • Jill is configuring the AutoArchive feature in Outlook 2016. What is the default setting in relation to when AutoArchive
    8·1 answer
  • Which network device sends data to every device that is connected to it?.
    7·1 answer
  • A Python file that contains variables and functions and can be used in other programs is called a
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!