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
melomori [17]
3 years ago
6

Given two numbers X and Y. Write a pseudo code to determine the difference between X and Y. If X-Y is negative, compute R=X+Y; i

f X-Y is zero, compute R=2X+2Y; and if X-Y is positive, compute R=X*Y. Print out the values of X, Y and R
Computers and Technology
1 answer:
Dmitry_Shevchenko [17]3 years ago
4 0

Program approach:-

  • Using the necessary header file.
  • Using the standard I/O namespace.
  • Define the main function.
  • Display the x and y values.
  • Return the value.

Program:-

//header file

#include <iostream>

//using namespace

using namespace std;

//main function

int main() {

   int X, Y, R;

   //display the x and y values

   cout<< "Enter X and Y values: ";

   cin>>X>>Y;

   

   if (X - Y > 0)

   {

       R = X*Y;

   }

   else if (X -Y < 0)

   {

       R = X + Y;

   }

   else

   {

       R = 2*(X+Y);

   }

   cout << "Value X = "<<X<<endl;

   cout << "Value Y = "<<Y<<endl;

   cout<< "Result R = "<<R<<endl;

   //return the value

   return 0;

}

Learn more value of X, Y, and R.

brainly.com/question/14293267

You might be interested in
A way to have cells in your spreadsheet change formats based on the value of the cells is called ________.
Deffense [45]
<span>Conditional Formatting will be the answer</span>
6 0
4 years ago
What are search tries? Why are they more efficient than usualsearching<br><br> algorithms?
Sati [7]

Answer:

Trie is a tree based data structure where the keys are strings.  

Search trees are a data structures in Computer Science in which they are based on trees.

Explanation:

Search trees are tree based data structures which are used to search elements in the tree as the names suggests (search tree). However, for a tree to perform as search tree the key it has to follow specific conditions. They are , the the key of any node has to be less than the all the keys present in the right sub trees and greater than all the keys present in the left subtree.

6 0
4 years ago
Who is good with Introduction to photography? I don’t know nothing about cameras if you do please contact me ASAP
son4ous [18]

ok i can help you with your questions

5 0
3 years ago
During the processing stage what does the computer do
Ann [662]
<span>The finished product is "output." In the electronic computer, data are the raw material or input to the computer.</span>
5 0
4 years ago
IF YOU COULD CREATE A SOCIAL NETWORK:, what would it be like? What would make it so special about the others? (If you want you c
frosja888 [35]

It would be like instagram

3 0
3 years ago
Other questions:
  • George is a contractor who creates websites and web applications. What is George working as?
    7·2 answers
  • write a program using if condition and print fail and try again if student marks are less than 33 using if condition and print f
    5·1 answer
  • Mary is entering her senior year of college. She has a meeting on Friday with her advisor to discuss her career plans.Mary is al
    15·1 answer
  • Ben's team is working on an English project. The members want to see everyone's progress on their part of the project. What tech
    7·2 answers
  • Which of the following is a malicious program that can replicate and spread from computer to computer?
    13·2 answers
  • Calcula l'energia (Kwh) consumida per una màquina de 30 CV que funciona durant 2 hores.
    12·1 answer
  • What is an advantage of storing data in a Data Lake, without applying a specific schema to it initially?
    10·1 answer
  • What will you see on the next line?<br> &gt;&gt;&gt;int(12.8)<br> ___
    15·1 answer
  • 3. Which property provided the labels in the list below?
    9·1 answer
  • Help me to solve please​
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!