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
Westkost [7]
3 years ago
5

Write an algorithm which gets a number N, and prints all the natural numbers less than or equal N. 3.

Computers and Technology
1 answer:
oksian1 [2.3K]3 years ago
3 0

Answer:

Algorithm:

1.Create a variable N.

2.Read the value of N from user.

3.for i=1 to N.

 3.1 Print value of i.

4.end program.

Implementation in C++:

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

int N;

cout<<"Enter value of N:";

// read the value of N

cin>>N;

cout<<"Natural number from 1 to "<<N<<" are:";

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

{

// print the numbers

   cout<<i<<" ";

}

return 0;

}

Output:

Enter value of N:6                                                                                                        

Natural number from 1 to 6 are:1 2 3 4 5 6

You might be interested in
You locate a web page that includes "edu" in the address, along with other words and symbols. the page is simple—a plain backgro
stich3 [128]
No, just because it is an edu address doesn't mean it is a good source. Avoid websites with minimal content or effort to the page they are most likely fake. <span />
7 0
4 years ago
the header, in an academic report, typically contains the author’s name and the current page number true or false
kolbaska11 [484]
TRUE

True


In most academic reports, most specifically, an MLA academic report, Student’s last name and current page number is contained in the headers. In MLA, which is most common used formatting guide in academic reports, headers numbers all pages consecutively within the right margin.


6 0
3 years ago
What method of research deals with large amounts of information that is analyzed and presented statistically?
Alenkinab [10]
Method of research deals with large amounts of information that is analyzed and presented statistically is quantitate.
6 0
3 years ago
เเปลภาษานิราศภูเขาทอง
Marianna [84]
Type it up in English
4 0
3 years ago
N the following pseudocode, what percentage raise will an employee in Department 8 receive?
goldenfox [79]

Answer:

"MEDIUM_RAISE" is the correct answer for the above question.

Explanation:

  • In the above pseudo-code, The first if statement will false because the question suggests that the department value is 8, which is greater than 5. But the first if statement states that the department value is less than 5.
  • Then the else-if statement gets checked which gives the true result. It is because the value of the department variable is 8, which is less than 14.
  • So the else-if statement block will be executed which assigns the MEDIUM_RAISE value to the raise.
  • Hence the answer is "MEDIUM_RAISE".

4 0
3 years ago
Other questions:
  • Which of the following is not an important consideration before a business invests in a particular technology?
    12·1 answer
  • Who are some of my emails not all deleting on my android i have to use my laptop to see them to delete them?
    12·2 answers
  • Ron travels extensively. He posts articles, photos, and videos about his experiences on a website. Which type of electronic comm
    9·1 answer
  • 80 points two simple computer questions
    13·2 answers
  • The OSI is a reference system that is used by most types of technicians EXCEPT _____.
    11·2 answers
  • What type of tool would be used to tighten a nut or bolt with an exact amount of twisting force?
    7·1 answer
  • which internet technology allows businesses to make presentation and share visual aids such as charts and graphs
    14·2 answers
  • What are the problems encountered in traditional approach tosystem development.
    9·1 answer
  • Which type of memory helps in reading as well as writing data?
    7·1 answer
  • What is a program answer these question<br>of grade-6​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!