Write a complete program that declares an integer variable , reads a value from the keyboard into that variable, and writes to standard output the variable’s value, twice the value, and the square of the value, separated by spaces.

LANGUAGE: C++

CHALLENGE:

Write a complete program that
declares an integer variable ,
reads a value from the keyboard into that variable, and
writes to standard output the variable’s value, twice the value, and the square of the value, separated by spaces.

Besides the numbers, nothing else should be written to standard output  except for spaces separating the values .

SOLUTION:

The Bad News: The content you are trying to access is only available to members.

The Good News: You too can be a member, simply Click Here.

Already a member?

Posted in ,

1 Comment

  1. balls on September 30, 2016 at 3:15 pm

    #include
    using namespace std;
    int main()
    {
    int balls;
    cin>>balls;
    cout<<balls<<" "<<(2*balls)<<" "<<(balls*balls);
    return 0;
    }

Leave a Comment

You must be logged in to post a comment.