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
What are the differences between sequential and random files? Which one do you think is better and why?
sukhopar [10]

Answer:

Sequential is better

Explanation:

Sequential is more organized while the more easier to make but less dependable one is random.

sequential is used for things such as date of birth, or where someone was born.

you can't do that with a random file.

5 0
4 years ago
What font family is Times New Roman an what font family is Arial?
Alexxandr [17]

Answer:

Some Font Examples

Generic Font Family                 Examples of Font Names

Serif                    Times New Roman Georgia Garamond

Sans-serif                          Arial Verdana Helvetica

Monospace                     Courier New Lucida Console Monaco

Cursive                        Brush Script MT Lucida Handwriting

Explanation:

hope it help

4 0
3 years ago
Read 2 more answers
Genres are useful for many reaseons. What are some explanations you can think of for how genres can be useful to players, game d
elena-14-01-66 [18.8K]
  • Genres are used in Readers as well as writers.
  • By using genre patterns in writers it has been accepted by readers for accomplishing their purposes.
  • Genres allow both writers and readers to establish a working relationship between each other.
  • Both writers and readers are required for gamers and game publishers.
  • So Genres are very useful to them.
7 0
3 years ago
​in a data dictionary, a(n) _____ is the smallest piece of data that has meaning within an information system.
Ksivusya [100]

In a data directory, a 01 is the smallest piece of data that has meaning within an information systems.

4 0
4 years ago
What are the pros and cons of using social media sites to look for a job?
azamat
Hey!

Pro: Easier access to necessary information
Con: It could be a scam.

Hope I helped! Have a gr8 day! :)
4 0
3 years ago
Read 2 more answers
Other questions:
  • What are the features that can extend record acees beyong Organization-wide defaults?A. Criteria-based sharing rules.B. Owner-ba
    12·1 answer
  • Which of the following statements is true according to the code?
    12·1 answer
  • Data owners ensure that only the access that is needed to perform day-to-day operations is granted and that duties are separated
    10·1 answer
  • Write a computer program that computes the duration of a projectile’s flight and its height above the ground when it reaches the
    11·1 answer
  • You are adding more features to a linear regression model and hope they will improve your model. If you add an important feature
    7·1 answer
  • In the program below, which two variables have the same scope?
    9·2 answers
  • Should Manufacturers Include Extra Programs in Operating Systems for Computers and Mobile Devices?
    10·1 answer
  • Which three statements are true of lossless compression?
    6·1 answer
  • While shopping online, Tucker visits a website that looks outdated and has limited reviews. Which of the following strategies sh
    11·1 answer
  • You can use the ____ method to search a string to determine whether it contains a specific sequence of characters.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!