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
Does anyone know edhesive 4.3 question 1
navik [9.2K]

No

.................................. :)

5 0
3 years ago
Read 2 more answers
You have deployed several 802.11b wireless networks at your company's location. Recently, users complained that they were having
SOVA2 [1]

Answer:

The correct answer to the following question is Microwave ovens.

Explanation:

Because microwave ovens and the WIFI(Wireless Fidelity) both are operated at the same frequency that is 2.4 GHz.

It is not a magic, of course, logically explainable effects the radio waves. When the devices use WiFi signals to connect to the Internet then these signals are sent with the radio waves and despite all the advanced features of wireless interference can happen.

7 0
3 years ago
Of the 3 primary electrical entites (voltage, current, and resistance )which is the result of the other two
sveta [45]

Answer: A

Explanation:cuz

5 0
3 years ago
Why do we use Boolean Logic operators when searching a topic?
gizmo_the_mogwai [7]
We use Boolean Logic operators because it saves more time when searching a topic. This connects pieces of information in a search allowing you to find exactly what you are looking for.
6 0
3 years ago
Susan wants to play softball and work after school. She cannot do both, so she decides to play softball. What is her opportunity
marta [7]
Opportunity cost is what you give up to do something else. Since she decided to play softball after school, she cannot work so the answer is B
5 0
3 years ago
Read 2 more answers
Other questions:
  • Encryption is the process of:
    12·1 answer
  • A computer can sort x objects in t seconds, as modeled by the function below:
    5·1 answer
  • Which item would you most likely keep in a database
    9·2 answers
  • Write an expression that executes the loop while the user enters a number greater than or equal to 0.
    10·1 answer
  • The idea that innovations in transportation and communication technologies has changed the way we think about distance and time
    9·1 answer
  • A company has an Aruba solution. The company wants to host a guest login portal with this solution, and the login portal must gi
    7·1 answer
  • ☢☢☢does anyone know how to do the TYNKER CANNON assignment ( lesson 2 intro to game design) I'll give BRANLIEST(¬‿¬)❤ dont answe
    11·2 answers
  • Write a python program that should determine from the range you choose to enter :
    9·1 answer
  • PLS HURRY<br> Look at the image below
    8·1 answer
  • Which of the following best describes a hotspot as
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!