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]
4 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]4 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
Question 16 (2 points) Question 16 Unsaved
strojnjashka [21]
I will help with as many as I can! :)
-
16. Slogans
17. Website Design and Development Process
18. Planning
19. (This question is the same as question 18 so I am at a loss here, sorry)
20. Confuse users, believing it is a hyperlink.

I apologize for the wait. I was trying to double check my sources. Also, I apologize in advance if something is wrong.
3 0
3 years ago
How can you have internet without subscribing to cable?
Svetach [21]
Sorry but you can’t there is now way
7 0
2 years ago
A derived class is a class that inherits data members and functions from a ____ class.
mezya [45]
The answer is superclass
6 0
3 years ago
Microsoft word is an example of utility software? <br><br>A.true <br>B.false​
monitta

Answer:

false

Explanation:

Ms word is only an application software

7 0
3 years ago
Read 2 more answers
What is the LER for a rectangular wing with a span of 0.225m and a chord of 0.045m
ch4aika [34]

Calculate LER for a rectangular wing with a span of 0.225m and a chord of 0.045m. The weight of the glider is 0.0500 Newtons. (Note: the wing span is the width of the wing and is measured from wing tip to wing tip, or perpendicular to the fuselage. The wing chord is the length of the wing measured parallel or along the length of the fuselage.)

Answer:

Area of rectangular wing = span × chord = 0.225×0.045= 0.010125m2

LER = Area/weight = 0.010125/0.0500 = 0.2025

4 0
3 years ago
Other questions:
  • Which social networking function came first?
    9·2 answers
  • Reggie has hired you to design a home network. The home network will share a printer but will mainly be used to stream movies to
    7·1 answer
  • To reboot a pc, hold down the ____ keys at the same time.
    15·1 answer
  • . The first step in devising security services and mechanisms is to develop a security policy True False
    11·1 answer
  • Once a software program has been through one test cycle performed by the programmers and is running proper
    10·1 answer
  • How would you classify an employee who is punctual, has respect for oneself and others, and takes initiative?
    13·2 answers
  • Which field of study would be most useful for a person who wants to work in a recycling plant?
    12·2 answers
  • ) A popular PivotChart that is used in Access is (Points : 4) column.
    9·1 answer
  • Explain the evolution of programming language​
    15·1 answer
  • Group of programs are software <br>​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!