answersLogoWhite

0


Best Answer

#include
#include
void main()
{
long int n,r,m,max=0,count=0;
clrscr();
printf("Enter the Number:");
scanf("%ld",&n);
m=n;
while(n>0)
{
r=n%10;
if(r>max)
max=r;
n=n/10;
}
printf("\nLargest Digit is = %ld",max);
while(m>0)
{
r=m%10;
if(r==max)
count++;
m=m/10;
}
printf("\n\nOccurence of Largest Digit %ld is = %ld",max,count);
getch();
}

output:

Enter the Number:68596999

Largest Digit is = 9

Occurence of Largest Digit 9 is = 4

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program that would find the count of occurrence of largest digit in the input number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the largest prime no that is stored in 8 bit pattern?

Write your own prime number program and find out.


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


What is the largest number you can write using the multiples of 3?

There is no largest number. You can just keep going.


How to write a program that ask user to enter numbers until user enter- 0 then find the biggest of entered numbers in C programming using while or do while?

int i, largest=0;do { scanf ("Enter a number (0 to exit): %d", i); if (i>largest) largest=i; } while (i!=0); printf ("Largest number is: %d\n", largest);


Is it possible to write the largest natural number?

No.


What is the largest number that is possible to write?

infinity


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


How do you write occurrence in a sentence?

I was confused by the occurrence of rain every afternoon this week.


What is the largest number you can write with two digits?

99


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


What is the largest six digit number you can write using the numbers 381724?

874321 is the largest number made from all these digits.


What is the largest number you can write using roman numerals?

The largest number you can write using Roman numerals without an overline at any symbol is 3999 (MMMCMXCIX), and the largest possible number is 3999999 (MMMCMXCIXCMXCIX, with an overline over the first nine letters.