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
Alja [10]
2 years ago
10

Write a small program basic c++, that defines a negative integer (between ‐1 and ‐255), converts it to a positive value and then

displays it on the console window.
Computers and Technology
1 answer:
ANEK [815]2 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main() {

int a=-156;//negative integer between -1 and -255.

a*=-1;//multiplying a to -1 so that it can become positive.

cout<<a;//printing a.

return 0;

}

Explanation:

The above written program is in C++ and in the program an integer a is defined with a negative value in the program it is -156.Then to convert it to positive integer we have to multiply a to -1 after that printing the value of a on the screen.

You might be interested in
An installation is:<br> please help asap
pogonyaev

Answer:  an installation is the act of putting something in, a device that stays in one place, a military base, or an art piece that often involves building and different types of materials.

Explanation:

Getting your new air conditioner put in is an example of an installation.

4 0
2 years ago
a.Write a Python function sum_1k(M) that returns the sum푠푠= ∑1푘푘푀푀푘푘=1b.Compute s for M = 3 by hand and write
stealth61 [152]

Answer:

def sum_1k(M):

   s = 0

   for k in range(1, M+1):

       s = s + 1.0/k

   return s

def test_sum_1k():

   expected_value = 1.0+1.0/2+1.0/3

   computed_value = sum_1k(3)

   if expected_value == computed_value:

       print("Test is successful")

   else:

       print("Test is NOT successful")

test_sum_1k()

Explanation:

It seems the hidden part is a summation (sigma) notation that goes from 1 to M with 1/k.

- Inside the <em>sum_1k(M)</em>, iterate from 1 to M and calculate-return the sum of the expression.

- Inside the <em>test_sum_1k(),</em> calculate the <em>expected_value,</em> refers to the value that is calculated by hand and <em>computed_value,</em> refers to the value that is the result of the <em>sum_1k(3). </em>Then, compare the values and print the appropriate message

- Call the <em>test_sum_1k()</em> to see the result

8 0
2 years ago
Technician A says that high pressure in recycled refrigerant is only caused by air contamination. Technician B says that recycle
hjlf

Answer:

a. A only

Explanation:

When air, is in excess of allowable amounts, it  can cause the system to operate at pressures that are higher than normal. This means that the recycled refrigerant is operating at high pressure. Thus Technician A is correct.

However, Technician B is incorrect because unlike reclaimed refrigerants where the process strip the refrigerant of impurities making it to meet the standards of a new refrigerant, the recycled refrigerant is not as pure as it's contaminants are only reduced.

Therefore, only technician A is correct.

6 0
3 years ago
Write a program that accepts 5 number and arrange them in ascending order​
Schach [20]
5
5 does this help?
5
5
5
7 0
3 years ago
Visual-verbal synergy has nothing to do with text, but solely with images used in a design.
Ilia_Sergeevich [38]
I think it is true (A) 
3 0
3 years ago
Other questions:
  • Your network employs basic authentication that centers on usernames and passwords. However, you have two ongoing problems. The f
    13·1 answer
  • What OS has a large market share but is limited because it can be installed only on one particular brand?
    8·2 answers
  • .<br> 1. Press the _______ key to move to the next cell in a row.
    14·2 answers
  • 5.
    6·1 answer
  • The _____ dialog box lets you specify which files are to be merged.
    14·1 answer
  • Which wildcard characters will return a single character when using the Find dialog box?
    6·2 answers
  • dr. olson likes to conduct research on the nature of prejudice and its effect on behavior. dr olson is probably a (n) - psycholo
    8·2 answers
  • On a rheostat the first terminal is connected to a
    14·1 answer
  • Write a program to find the sum of first 10 even numbers in qbasic​
    15·1 answer
  • Would it be feasible to combine fixed length field and variable length field format in single disk
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!