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
A _______ is a piece of computer hardware used for the modulation and demodulation of data between digital and analog formats.
mario62 [17]
'Modem'. A hardware that changes analogy to digital and vice versa.
5 0
3 years ago
Server farms such as Google and Yahoo! provide enough compute capacity for the highest request rate of the day. Imagine that mos
EleoNora [17]

Answer:

a) Power saving = 26.7%

b) power saving = 48%

c) Power saving = 61%

d) Power saving = 25.3%

Explanation:

3 0
4 years ago
Which tab would you click to access the autosum feature?
Bogdan [553]
On Excel, you click the Formulas tab. 

6 0
3 years ago
Please help
zvonat [6]

Answer:

First check the if the adapters on the router or site are connected (Ipconfig)

Next run a flush Dns to clear the sites dns logs (ipconfig/flushdns)

If non of that works you would run a restart on the server that is transfering data through the site.

If that doesn't work you will have to call a tech support from another company or your boss to tell him that there is nothing you can do and to ask for help!

Explanation:

Hopefully this helps! BTW I'm 13 so I wouldn't rely on my information that is personal what I would do though.

6 0
3 years ago
Does anyone know how to remove specific columns of data sets in R studio?
timofeeve [1]

Answer:The most easiest way to drop columns is by using subset() function.

Explanation:

In the code below, we are telling R to drop variables x and z. The '-' sign indicates dropping variables. Make sure the variable names would NOT be specified in quotes when using subset() function.

5 0
3 years ago
Other questions:
  • Simon wants to use an invoice template created by Office.com. The first step after selecting the File tab is to select
    14·1 answer
  • While working on a group project, you notice something does not look right in the presentation. You call a meeting with your tea
    14·2 answers
  • Write a function that finds the number of occurrences of a specified character in the string using the following header: def cou
    9·1 answer
  • What is the full form of RAM. ​
    5·2 answers
  • The ____ object can trigger a selectedindexchanged event when a selection is made
    5·1 answer
  • Assume you are a security professional. You are determining which of the following backup strategies will provide the best prote
    10·1 answer
  • How can I get more views on my you tube channel "Braeden Eischen" without paying anything
    5·1 answer
  • How do I change my PATH?
    7·2 answers
  • They will wash the car change into tag question​
    6·1 answer
  • If the middle number is lesser than the candidates then u eliminate the ___ half of the data​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!