subject

Re-type the code and fix any errors. The code should convert non-positive numbers to 1.
if (userNum > 0)
cout << "Positive." << endl;
elsecout << "Not positive, converting to 1." << endl;
userNum = 1;
cout << "Final: " << userNum << endl;

#include
using namespace std;
int main() {
int userNum;
cin >> userNum;
/* Your solution goes here */
return 0;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 17:30
How are natural numbers, whole numbers, integers, and rational numbers related
Answers: 3
question
Computers and Technology, 22.06.2019 22:40
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Rafael needs to add a title row to a table that he has inserted in word. what should he do? use the alignment options. use the merge and center option for all the cells in the top row. use the merge and center option on the first two cells in the top row. none of the above
Answers: 3
You know the right answer?
Re-type the code and fix any errors. The code should convert non-positive numbers to 1.
if (us...
Questions
question
Mathematics, 18.03.2021 02:00
question
English, 18.03.2021 02:00
question
Business, 18.03.2021 02:00
question
Mathematics, 18.03.2021 02:00
question
Mathematics, 18.03.2021 02:00
question
Mathematics, 18.03.2021 02:00
question
History, 18.03.2021 02:00
Questions on the website: 13722363