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
Which of the following is NOT an example of editing?
Genrish500 [490]

Answer:

ang answer po at proofreading written

content

Explanation:

if I wrong please correction me!

8 0
2 years ago
Effective nonverbal communication can cause tension.<br><br> True or False
agasfer [191]

Explanation:

When your nonverbal signals match up with the words you're saying, they increase trust, clarity, and rapport. When they don't, they can generate tension, mistrust, and confusion.

4 0
3 years ago
How to find determinant of ​
babymother [125]
Some proteins must be altered before they become functional.
5 0
3 years ago
In a proper webpage, which tag holds all of a webpages visible HTML?
Evgen [1.6K]

Body.


head contains all of the data that we generally don't see.


Link is used to link to external stylesheets.


script is where you would type scrips.


doctype is used to tell the browser the document type.

6 0
3 years ago
If you want to selectively darken an area of an image you could use the
DerKrebs [107]
Create an adjustment layer and create a hue and saturation layer. You'll see sliders so adjust them to your liking. next select a layer mask and fill it will black. then select which areas you want to darken and use the wand tool. Apply a gradient mask if you want. 
5 0
3 years ago
Other questions:
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • Which of the following is not an algorithm?
    8·1 answer
  • You're researching information about titanium bike frames. Which Web site is probably the least biased? The web site of a nation
    6·1 answer
  • You have decided to install the DNS server role on Nano Server. What specific type of zone configuration is not supported when u
    14·1 answer
  • A group of users is unable to connect to the network. When testing several of the PCs and issuing the command ipconfig, the tech
    10·1 answer
  • Which is the most popular language used in game programming?
    5·2 answers
  • Write a program to find the product of 3 numbers
    8·2 answers
  • What is python, the coding language
    6·2 answers
  • 4. What is the formula for calculating the file size?
    11·1 answer
  • Please do this now
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!