If you include all zeroes, then it should be 1,000,000,000. Otherwise it’s 999,999,999.
Think of how between 0-9 theres 10 numbers, and use that logic towards 000000000-999999999
Answer:
#include <iostream>
using namespace std;
class Digits
{
public:
int num;
int read() //method to read num from user
{
cout<<"Enter number(>0)\n";
cin>>num;
return num;
}
int digit_count(int num) //method to count number of digits of num
{
int count=0;
while(num>0) //loop till num>0
{
num/=10;
count++; //counter which counts number of digits
}
return count;
}
int countDigits(int num) //method to return remainder
{
int c=digit_count(num); //calls method inside method
return num%c;
}
};
int main()
{
Digits d; //object of class Digits is created
int number=d.read(); //num is read from user
cout<<"\nRemainder is : "<<d.countDigits(number); //used to find remainder
return 0;
}
Output :
Enter number(>0)
343
Remainder is : 1
Explanation:
As program is missing to find errors , a logically write program is written to find the remainder when a number is divided by its number of digits. A class Digits is constructed which has public variable num and methods read(), digit_count(), countDigits().
- read() - This method reads value of num from the user and return num.
- digit_count() - This method takes a integer as parameter and counts the number of digits of a number passed as argument. while loop is used to increement the counter until num<0. This returns the value of count.
- countDigits() - This method takes a integer as a parameter and returns remainder when the argument is divided by number of digits of argument. Number of digits is calculated by using method digit_count().
At last in main method , object of Digits class is created and its methods are used to find the output.
Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
Among the choices above the answer is C which is <span>of government taxation
To complete the sentece "</span>Ultimately, there exists a ceiling on efficiency because of government taxation
Phone screens are smaller, but are apparently more HD than a full, widescreen TV. Why? The pixels are small but they can fit in just that little screen space, but is harder to fit onto a relatively gigantic TV screen.
He should add more security applications to the software and inform the company to not tell any details.