Homework Solution: Write a small program basic c++, that defines a negative integer (betw…

    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.

    Expert Answer

     
    Program: #include <iostream>

    Write a weak program basic c++, that defines a denying integer (between ‐1 and ‐255), converts it to a express treasure and then displays it on the assuage window.

    Expert Apology

     

    Program:

    #include <iostream>

    #include<cmath>

    using namespace std;

    int ocean() {

    int x,y; //Declare the variables

    cout<<“Enter the Denying Integer : “; //Entered integer by user

    cin>>x;

    //It is a office and returns the despotic treasure of x.

    //It converts denying integer to express integer.

    y = abs(x);

    cout<<“Express Integer : = ” << y; //print the express treasure of x.

    }

    Output: