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
Animation and transition effects will distract your audience when using a slide show presentation aid. True or false ?
lions [1.4K]
I suspect the answer they're looking for is false. However, as an experienced professional in learning and development, I can tell you that when done right these effects can enhance a presentation.
4 0
3 years ago
Read 2 more answers
Which functions can you use to find the square root of a number, and to find the current date, respectively?
JulsSmile [24]

1. A. the SQRT is the squareroot. 2. may be C. Today but I've never heard of a function that returns the date!

8 0
3 years ago
Read 2 more answers
Which word best completes the comparison of Beowulf and Grendel?
Hatshy [7]

Answer:

sympathetic

Explanation:

If you will have a go at Beowulf, you will find that Grendel is a dangerous demon for whom humanity means nothing, and people for him are just like something that is to be eaten. However, when you will have a go at Grendel, you will find that he is not just a beast without the brain, as he does have affection and conception.

4 0
3 years ago
Read 2 more answers
Implement the function calcWordFrequencies() that uses a single prompt tonread a list of words (separated by spaces). Then, the
Morgarella [4.7K]
The function it puts those consoles
4 0
3 years ago
Please help I have errors codes and don’t know that they are.<br> Please help thank You.
gizmo_the_mogwai [7]
Refresh, power off and repeat
4 0
3 years ago
Read 2 more answers
Other questions:
  • Prominent is another word for stands out. True False
    13·1 answer
  • The variable planet_distances is associated with a dictionary that maps planet names to planetary distances from the sun. Write
    12·1 answer
  • , 13 dB correspond to a power ratio of ....?
    14·1 answer
  • 17. When an industrial electrical circuit requires a 220 VAC single phase power supply, the electric power supply circuit is nor
    7·1 answer
  • Write a police description a person who know you well​
    12·1 answer
  • The function below takes two parameters: a string parameter: csv_string and an integer index. This string parameter will hold a
    5·1 answer
  • Define a function below, filter_out_strs, which takes a single argument of type list. Complete the function so that it returns a
    10·1 answer
  • Please choose odd one out please tell fast​
    12·1 answer
  • How does the technology affect you daily living? Give situations where you use technology and how it helped you.​
    5·1 answer
  • Write a recursive function called digit_count() that takes a positive integer as a parameter and returns the number of digits in
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!