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
vodka [1.7K]
3 years ago
9

Read two numbers on the keyboard. Display for each: how many digits it consists of, which is the sum of the digits, and which of

the two digits is greater.
it is in c++ help me fast pls
Computers and Technology
1 answer:
Fantom [35]3 years ago
6 0

Answer:

Here it is

Explanation:

#include <iostream>

using namespace std;

int main()

{

   int a, b;

   cin >> a >> b;

   int nr_digits1 = 0, nr_digits2 = 0;

   int sum1 = 0, sum2 = 0;

   int max_digit1 = 0, max_digit2 = 0;

   while (a > 1)

   {

       int digit = a % 10;

       nr_digits1 += 1;

       sum1 += digit;

       if (digit > max_digit1)

       {

           max_digit1 = digit;

       }

       a /= 10;

   }

   while (b > 1)

   {

       int digit = b % 10;

       nr_digits2 += 1;

       sum2 += digit;

       if (digit > max_digit2)

       {

           max_digit2 = digit;

       }

       b /= 10;

   }

   

   cout << "For a: \n" << "   No. of digits: " << nr_digits1 << "\n";

   cout << "   Sum of digits: " << sum1 << "\n";

   cout << "   Max digit: " << max_digit1 << "\n";

   cout << "\n";

   cout << "For b: \n" << "   No. of digits: " << nr_digits2 << "\n";

   cout << "   Sum of digits: " << sum2 << "\n";

   cout << "   Max digit: " << max_digit2 << "\n";

   return 0;

}

You might be interested in
What is the purpose of a fax cover sheet?
Deffense [45]
A fax cover sheet is the first sheet that gives all the information that is needed.
8 0
4 years ago
In a system with paging as the address translation mechanism, using multi-level paging always causes less memory usage for stori
Zarrin [17]

Answer:

The given statement is "True". A further explanation is given below.

Explanation:

  • Multi level paging can conserve storage capacity as opposed to sequential paging, including some of its hierarchical method Multi-level paging completing such.
  • Rather precisely, with either the aid of the number of co-association, clients will determine which unique category of 2²⁰ pages whose data are stored as well as the pick itself.
3 0
3 years ago
To delete a comment, right click the comment and then select the ____ command.
aleksandrvk [35]

delete command is your answer i tink

8 0
3 years ago
Read 2 more answers
HELP PLEASE!!!Salman wrote a SMART goal for class. Part of the goal includes the fact that he will complete Ms. Murray's extra-
kirill115 [55]

Answer:

the answer is specific

Explanation:

5 0
4 years ago
Read 2 more answers
When an isolated object becomes charged by induction, which best describes the net charge on the object?
cupoosta [38]
<span>C. The net charge does not change. 

The charge remains neutral and thus, polarization takes effect. Polarization simply means electrons and protons are separated into opposites. To best explain this, we can use a rubber balloon that has been rubbed against animal fur. Assume is has been negatively charged, bring it close to the object and make sure that these two do not touch. Electrons within the object will experience a repulsive force. 
</span>
Since repulsion will be greatest for those electrons nearest the balloon, many of them will be induced into moving away from the rubber balloon. By default, electrons are free to move from atom to atom and thus there will be a mass migration of balloons side of the object to the opposite side of the object. <span>This will leave more atoms on the rubber balloon’s side of the object with a shortage of electrons and will be positively charged and vice versa. </span>Overall, the object will become electrically neutral. 

 
5 0
3 years ago
Other questions:
  • Your computer has two basic types of software: system software and ________ software.
    9·1 answer
  • Find the cell address of first column and last row some one pls answer :'(​
    9·1 answer
  • The device that links computers via communication lines is called the:
    15·1 answer
  • Merge arrays A and B into array C using merge sort algorithm. Give final sorted numbers of C using colored numbers without showi
    13·1 answer
  • A patient presents at an outpatient urgent care facility with an acute illness and is seen by a provider. A detailed history wit
    13·1 answer
  • Communication is defined as__________.
    10·1 answer
  • Suppose we wanted to make change for purchases and wanted to use the least number of coins possible. Here is a greedy algorithm:
    5·1 answer
  • What is the best resource to learn python?
    14·2 answers
  • ANYONE WANNA FRIEND ME ON DISCORD ゴRose joestarゴ#2088
    9·1 answer
  • How many discussion posts must you complete to meet the Expectations of the replies category
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!