Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to a method that squares the number and to a method that cubes the number. The program displays the results before reprompting the user. Create the two methods that square and cube a number passed to them, and then return the calculated value.

1 answer

#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
int x = 10;
int y = 2;
int sum, difference, product, quotient;
sum = x + y;
difference = x - y;
product = x * y;
quotient = x / y;
cout << "The sum of " << x << " & " << y << " is " << sum << "." << endl;
cout << "The difference of " << x << " & " << "y << is " << difference << "." << endl;
cout << "The product of " << x << " & " << y << " is " << product << "." << endl;
cout << "The quotient of " << x << " & " << y << " is " << quotient << "." << endl;
getch();
}
Similar Questions
  1. Create the logic for a program that continuously prompts a userfor a numeric value until the user enters 0. The application
    1. answers icon 0 answers
  2. Pseudocode -Create the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The
    1. answers icon 3 answers
    1. answers icon 1 answer
    1. answers icon 2 answers
more similar questions