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 can indicate what careers will be enjoyable ?
pishuonlain [190]

Answer: c. Interests

Explanation:

A person's interests are things that they love to do because they find those things to be enjoyable for example, gaming, writing or travelling.

To find out what careers a person would find enjoyable therefore, the interests can be looked at because if the person enjoy doing those things without it even being a job then they would probably enjoy those things in a career setting as well. For instance a person who enjoys writing would probably find a career in jornalism to be enjoyable.

5 0
3 years ago
NEED HELP ASAP! BRAINLIEST AND 20 PTS TO CORRECT ANSWER!
son4ous [18]

The correct answer is C.

8 0
3 years ago
Complete the steps to evaluate the following
kirill115 [55]

Answer:

log base 3a= -0.631.log a/3 base 3

Now, -log m= log 1/m

hence,

log base 3a= 0.631.log 3/a base 3

log base 3a/log 3/a base 3 =0.631

log base 3 ( a.3/a) =.631 since, log m/logn =log n(m)

log base 3 3=0.631

Hence, answer is log base 3 3=0.631

Explanation:

Please check the answer section.

3 0
3 years ago
Read 2 more answers
Suppose you have a string matching algorithm that can take in (linear)strings S and T and determine if S is a substring (contigu
Zielflug [23.3K]

Answer:

no seishsssssssssssssssssssss

8 0
3 years ago
Read 2 more answers
Which statement does not describe the guidelines for the use of text in presentation programs?
olganol [36]
Choice a
have a great day

7 0
2 years ago
Other questions:
  • Darnell is preparing to read A Rocket to the Stars for class. What might he predict based on the title?
    6·2 answers
  • A cloud file system (CFS) allows users or applications to directly manipulate files that reside on the cloud.
    6·1 answer
  • from january 2005 through july 2015, approximately how many electronic data records in the United States were breached, exposing
    13·1 answer
  • What are three ways you cite evedince
    5·2 answers
  • Which of the following is a popular open source intrusion detection system that runs on SmoothWall?? Synchronous Dynamic Random
    6·1 answer
  • The file descriptor stderr is represented by the number ____.
    6·1 answer
  • 27. If X and Y are int type variables,
    14·1 answer
  • What finger should be on the Y key?
    12·2 answers
  • Which of the following boxes should replace question mark
    8·1 answer
  • Good day Statistical Methods tutor , I would like to know the formula for calculating the percentage of stockouts for the given
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!