answersLogoWhite

0


Best Answer

Count them unless the number has a recurring ending.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you find most occurring digit in a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you separate digits in c plus plus?

Repeatedly divide the number by 10 and store the remainder (the modulo). By way of an example, if the number were 12345: 12345 % 10 = 5 (first digit) 12345 / 10 = 1234 1234 % 10 = 4 (second digit) 1234 / 10 = 123 123 % 10 = 3 (third digit) 123 / 10 = 12 12 % 10 = 2 (fourth digit) 12 / 10 = 1 (fifth digit) This algorithm forms the basis of number reversals. The following function demonstrates the most efficient way of reversing any number in the range -2,147,483,648 to 2,147,483,647, inclusive. int RevNum( int num ) { const int base = 10; int result = 0; int remain = 0; do { remain = num % base; result *= base; result += remain; } while( num /= base); return( result ); }


Develop a program that reads a floating point number and then replace the right most digit of the integral part of the number?

/* program without if statement */ #include<stdio.h> #include<conio.h> void main() { int a,c; float b; clrscr(); printf("Enter the value \n"); scanf("%f",&b); a=c; c=a%10; printf("the right most digit is %d",c); getch(); }


What is a c program to reverse a five digit number?

#include <stdio.h> int main(void){ // Local Declerations int intNum; int midDigit; // Statements printf("Enter a 5 digit integral number: "); scanf("%d", &intNum); //the assignment expression below is used to calculate the mid digit oneDigit = (intNum % 1000) / 100; printf("\nThe middle digit is: %d", oneDigit); return 0; }


What elements of your job do you find the most difficult?

What elements of your job do you find most difficult


Write a shell script to print given number in reverse order in Unix?

# Algo: # 1) Input number n # 2) Set rev=0, sd=0 # 3) Find single digit in sd as n % 10 it will give (left most digit) # 4) Construct revrse no as rev * 10 + sd # 5) Decrment n by 1 # 6) Is n is greater than zero, if yes goto step 3, otherwise next step # 7) Print rev # if [ $# -ne 1 ] then echo "Usage: $0 number" echo " I will find reverse of given number" echo " For eg. $0 123, I will print 321" exit 1 fi n=$1 rev=0 sd=0 while [ $n -gt 0 ] do sd=`expr $n % 10` rev=`expr $rev \* 10 + $sd` n=`expr $n / 10` done echo "Reverse number is $rev"