answersLogoWhite

0


Best Answer

there could be a part in it like this:

int num, digit;

int count [10];

do {

digit = num%10;

num != 10;

++count[digit];

} while (num);

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you Write a program that determines the number of occurrences of each digit in a given integer n?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the code of a c program that will read in a positive integer value and determine If the integer is a prime number and If the integer is a Fibonacci number?

see the program


How do you Write a C program to reverse an Integer number.?

Reference:cprogramming-bd.com/c_page2.aspx# reverse number


Can 3.4 be an integer?

No, 3.4 is not an integer. It is a rational number and a real number, but not an integer.


How is a rational number that is not an integer different from a rational number that is an integer?

A rational number which is an integer can be simplified to a form in which the denominator is 1. That is not possible for a rational number which is not an integer.


Is 14.5 an integer?

The number 14.5 is a decimal and not an integer. An integer is any number which is a whole number.


Is every integer a rational number or is every rational number an integer?

Every integer is a rational number.


Is it true that the sum of a negative integer and a positive integer is always positive?

It depends, if a number with positive integers is greater than the number with the negative integer therefore the sum will be in positive integer. And if the number with positive integer is less than the number with the number with negative integer then the sum will be in negative integer.


Is 78 an integer?

No, it is a decimal number.


Is a negative number is an integer?

Unless the integer is fractional it is not an irrational number.


How do you write a program to find number of zeros for the given number in c program?

Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter. If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.


What function returns the number of occurrences of a specified character in the input string?

The charAt function returns the number of occurrences of a specified character in the input string.


Is a decimal number an integer?

A decimal number is not an integer. An integer is a number that is not a fraction, and decimal numbers are decimal fractions.