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
If you were setting up a network with 100 nodes and you wanted no more than 25 nodes per segment: what devices and connections w
STatiana [176]

Since at present number user or nodes in an organization counts is 100 and it can be further extended. Moreover concurrent at presented is 25 nodes is active.

<u>Explanation:</u>

So as best practice network administrator has keep in mind and select hardware application.

1. Server with high end rams and further extendable.

2. Minimum life of hardware such as routers, switch or managed or firewall should be considered or two years. But to technology improvement it is possible for 1 year only

3. Upgradable hardware appliances and software updates should be possible with mini cost effect.

4. Network security   and update or upgradable workstation or desktop or laptop to be consideration.

5. Functional operation of an organization should run smoothly.

8 0
3 years ago
Leslie’s parents put a big dry-erase board on the refrigerator and let the kids write suggestions for how to organize and assign
blondinia [14]

Answer

determine possible solutions

Explanation:

im assuming

ty for the thanks

5 0
2 years ago
Which statement describes borders and shading ?
Marina CMI [18]

Answer: Borders are rules you can add to any or all of the four sides of a paragraph. Shading is the color or artistic design you use as background for a paragraph. Borders and shading are formatting tools for enhancing text, paragraphs, table cells or frames.

3 0
3 years ago
Write a function named shareALetter that takes one parameter, wordList – a list of words. Create and return a dictionary in whic
Arte-miy333 [17]
Can u send anything to understand it
7 0
3 years ago
Within the seven domains of a typical IT infrastructure, there are particular roles responsible for data handling and data quali
nikitadnepr [17]

Answer:

The answer is "auditors"

Explanation:

Description to this question can be described as follows:

  • Auditors are professionals who analyze business and corporate accounts to determine, that the financial reports are accurate and lawful. It will serve as a consultant to suggest possible measures for risk avoidance or cost reduction.
  • Data security is the mechanism to avoid theft, loss of sensitive information, and information quality is critical and it is not able to know or stay in contact with your clients without high-quality data, that's why auditors are the correct answer and other choices can't be defined in the following senior.
7 0
3 years ago
Other questions:
  • Write a program that allows the user to convert a temperature given in degrees from either Celsius to Fahrenheit or Fahrenheit t
    13·1 answer
  • Ok, so this isn't a tech question it's about a game, moomoo.io so don't hate on this if you don't know it, 40 points to whoever
    12·2 answers
  • Is it okay to leave your car running while parked?
    15·1 answer
  • Fill the validateForm function to check that the phone number contains a number (use the isNaN function) and that the user name
    8·1 answer
  • Determine the “answer” to the formula according to the spreadsheet below:<br><br> =A3 + B4 + D2.
    15·1 answer
  • What are two reasons why tuples exist in Python?
    9·1 answer
  • Which of the following best describes
    13·1 answer
  • Information about hardware engineers?
    9·1 answer
  • Question 3 of 10<br> What was the fly in the ointment of Timmy's friendship with Rollo?
    10·1 answer
  • Mechanisms that can be used to rescue accident victims
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!