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
postnew [5]
3 years ago
11

Read an integer from keyboard and then print the result of the sum obtained by adding the entered integer to the integer formed

by reversing the order of the digits. (For example: entered number = 123. Sum = 123+321 = 444)
Computers and Technology
1 answer:
Stels [109]3 years ago
3 0

Answer:

Following are the program in C++ language

#include <iostream> // header file

using namespace std; //  namespace std;

int main() // main function

{

int number,n1,rem; // variable declaration

int sum,sum1=0;// variable declaration

cout<<"Enter the number :";

cin>>number;// Read the number

n1=number; // initialized the value of number with the n1

while(n1>0) // iteating the  while loop

{

   rem=n1%10; // finding the reminder

   sum1=10*sum1+rem;  // storing the sum

   n1=n1/10;

}

sum=sum1+number; // calculate the sum

cout<<"The sum is:"<<sum; // Display sum

   return 0;

}

Output:

Enter the number :123

The sum is:444

Explanation:

Following are the Description of the Program

  • Read the value of "number" in the "number" variable of int type .
  • Initialized the value of "number" in the "n1' variable.
  • Iterating the while loop until the n1>0.
  • In this loop we reverse the number in the "sum1" variable
  • Finally print the sum in the "sum" variable

You might be interested in
A _____ model is one that is automatically adjusted based on changing relationships among variables.
BabaBlast [244]

Answer: dynamically modified model

Explanation:

7 0
1 year ago
​Browser-based database applications differ from traditional applications in that they​ ________.
alukav5142 [94]

Answer:

The correct option to the following question is option A.

Explanation:

Traditional database system is also known as the data warehouses and the relational database system which have been primary way organizations and the businesses have analyzed and stored their data and information for past 20 to 50 years. Traditional application of database systems are designed from ground up to the work with the data that has the primarily structured data.

A Web database or a browser-based database is the database application which is designed for accessed and managed from the Internet. Website or browser operators can be manage the collection of present analytical results-based and data on the data in the Browser-based database application.

8 0
3 years ago
Write a C++ function with the following signature: void readAndConvert() The function takes no parameters and returns no value.
shepuryov [24]

Answer:

The function is as follows:

void readAndConvert(){

   int n; string symbol,name;

   cin>>n;

   cin>>symbol;

   cin.ignore();

   getline (cin,name);

   vector<string> trades;

   string trade;

   for (int inps = 0; inps < n; inps++){

       getline (cin,trade);

       trades.push_back(trade);}

   

   cout<<name<<" ("<<symbol<<")"<<endl;

   for (int itr = 0; itr < n; itr++){

       string splittrade[3];        int k = 0;

       for(int j=0;j<trades.at(itr).length();j++){

           splittrade[k] += trades.at(itr)[j];

           if(trades.at(itr)[j] == ' '){

               k++;    }}

cout<<splittrade[2]<<": "<<floor(stod(splittrade[1]) * stod(splittrade[0]))<<endl;        }

   }

Explanation:

See attachment for complete program where comments are used to explain each line

Download cpp
4 0
2 years ago
Education leads to higher wages lower unemployment.* True or false
natta225 [31]

Answer:

True

Explanation:

I would say True but I don't really know a Explanation. but if they have education then they must know more so they get paid more.

5 0
3 years ago
A “greedy algorithm” sometimes works well for optimization problems???
mrs_skeptik [129]
An optimization problem is one in which you want to find, not just a solution, but the best  solution •<span>A <span>“greedy algorithm” sometimes works </span></span><span>well for optimization problems </span>•<span>But only a few optimization problems can </span><span> be solved by the <span>greedy method</span></span>
5 0
3 years ago
Other questions:
  • In a switch statement, if a break statement is missing, _______________. Select one: a. the default case is automatically execut
    15·1 answer
  • You are using a crimper to attach an RJ-45 connector to a Cat 6 UTP cable. You need to use the T568A standard to connect the ind
    6·1 answer
  • I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if
    11·1 answer
  • A power supply unit for a computer converts:
    7·1 answer
  • Use unit analysis to determine the unit of measurement for the expression 10x + 25y​
    8·1 answer
  • The following program segment is designed to compute the product of two nonnegative integers X and Y by accumulating the sum of
    9·1 answer
  • Kahnacademy sucksi am so mad i want to k ..<br> ill myself
    14·1 answer
  • People who are reading this:
    5·2 answers
  • In 1868 the qwerty keyboard was patented by this man
    5·1 answer
  • explain the following joke: “There are 10 types of people in the world: those who understand binary and those who don’t.”
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!