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
Hye I'm new branily I don't no use in this aap please follow me​
mixas84 [53]
Um ok? I think u have to have more points to be able to follow people tho
8 0
3 years ago
Ted is asked to create a page containing his family photos for a family reunion website. He will has about 20 pictures to post,
Dafna11 [192]

Answer:

<em>Alignment Attribute</em>

Explanation:

In web development (HTML), the align attribute <em>states the orientation according to the surrounding component of an < object > element.</em>

The element < object > is an insert element (it does not insert a new line on a page), which means that it can be wrapped around by text and other components.

Ted might find it easier to use this element / component to make sure his objects are well aligned.

Furthermore, defining the alignment of the < object > by the surrounding elements may be useful.

6 0
4 years ago
Which statement describes a characteristic of SRAM in a PC?
svlad2 [7]

It is used for cache memory.

Further Explanation:

Cache memory is the memory that stores the instructions and data that is used repeatedly. If the processor wants some data it first looks into cache memory then the processor doesn't has to look into the main memory for the data or instructions which is more time consuming. As the SRAM uses small but a constant source of power, it is usually used for making cache memories. Moreover it is benficial to keep the previously used data in SRAM(Which is faster) than acessing DRAM (Which is way more slow than SRAM.

  • Learn more about RAM in brainly.com/question/10602589
  • brainly.com/question/5159824
  • brainly.com/question/6062548

#LearnwithBrainly

8 0
3 years ago
Where do you find the Merge Style dialog box to merge styles from one workbook to another? in the Home tab, then Styles group in
DiKsa [7]

Answer:A in the home tab then styles group

Explanation:

3 0
3 years ago
Read 2 more answers
What kind of game was Pole Position?
sesenic [268]
A racing game, with cars on a race track.
7 0
3 years ago
Other questions:
  • Dereck works for long hours on his computer. He frequently experiences physical strain by the end of the day because he does not
    13·2 answers
  • Write a short program that uses a for loop to write the numbers 1 through 10 to a file
    11·1 answer
  • What is different between a pc mouse and a real mouse
    12·2 answers
  • Create an application for a library and name it FineForOverdueBooks. TheMain() method asks the user to input the number of books
    7·1 answer
  • True or False, A column is a horizontal arrangement for items of information.
    15·1 answer
  • Plz tell the answer I I'll mark u as the brainliest
    14·1 answer
  • A location in memory which stores a value, the value can change as the program is running is
    12·1 answer
  • SYSTEMY INFORMATYCZNE: Archiwizacja i kompresja zbiorów systemu Linu
    8·1 answer
  • Luis saves an attachment that he received from Kevin. Where will the attachment save by default?
    5·1 answer
  • What term is used to describe selecting and viewing information in a database?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!