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
vovangra [49]
3 years ago
12

Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.

Computers and Technology
1 answer:
LUCKY_DIMON [66]3 years ago
5 0

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Download cpp
You might be interested in
Write steps: To open an old documents​
myrzilka [38]

Answer:

1.Click.

2.Choose “All Programs”

3.Then select, the “Microsoft Office” folder.

4.Now, open your desired Office application. 5.for e.g Microsoft Word 2010.

6.Once the application opens, select.

Click.

7.Now, select the document you wish to open in Office 2010 and click.

3 0
2 years ago
This is not a factor that you should use to determine the content of your presentation. Your audience your goals your purpose yo
aksik [14]

Your technology I believe

4 0
3 years ago
Read 2 more answers
Server virtualization in windows server 2012 r2 is based on a module called the
alexgriva [62]
<span>Server virtualization in windows server 2012 r2 is based on a module called the</span> hypervisor.
3 0
3 years ago
Gaming related
Blababa [14]

Answer:

yes affects your K/D

Explanation:

winner winner chicken dinner

please mark me please brainliest or mark thanks

5 0
2 years ago
This is due in like an hour but I'm confused so please do lend assistance
blagie [28]
Yes you do have to program it first.
4 0
3 years ago
Other questions:
  • "is it important to have a firewall on a home network
    10·1 answer
  • Technician A says that automotive engine blocks are usually classified by the number of cylinders the block. Technician B says t
    9·1 answer
  • A teacher takes the following steps when beginning to apply conditional formatting to a spreadsheet. Format Conditional Formatti
    8·1 answer
  • 1. If this traffic signal is turned on after the red light, it means you may cross the intersection, but you _______ wait until
    12·2 answers
  • n physics, a common useful equation for finding the position s of a body in linear motion at a given time t, based on its initia
    9·1 answer
  • The type of medium used to hide data in steganography is referred to as __________. This may be a photo, video, sound file, or V
    12·2 answers
  • Which best describes how a supporting database will be structured?
    10·1 answer
  • In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.
    8·1 answer
  • 1.
    7·1 answer
  • 1. The running configuration is also known as the _____________ (Select Two) a. Startup config b. Working configuration c. Curre
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!