answersLogoWhite

0


Best Answer

#include<stdio.h>

#include<conio.h>

main()

{

int n,max=0,rem;

printf("\n enter a number");

scanf("%d",&n);

while(n!=0)

{

rem=n%10;

n=n/10;

if(rem>max)

{

max=rem:

}}

printf("\n the largest digit is: %d",max);

getch();

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find the largest digit of a number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Find the difference between the largest 8 digit number and the smallest 6 digit number?

It is 99,899,999.


What is the largest four digit number that is a multiple of 7?

The largest four digit whole number that is a multiple of 7 is 9,996.Find the largest four digit number : 9999Divide 9999 by 7Round the answer down to the nearest whole numberMultiply the answer from #3 by 7


How many 8 - digit numbers are there in all?

To find that, simply take your largest 8-digit number: 99999999 And subtract your largest 7-digit number: 9999999 That leaves you with 90000000, or ninety-million.


Shell program to find the smallest digit of a given number?

syntax error


Find the difference between the largest four-digit number and the smallest four-digit number?

Assuming you do not want a number with leading zeros, the difference is 8999.


What is the largest three-digit even number that uses the digits 3 4 and 5?

To find the largest three-digit even number using the digits 3, 4, and 5, you need to arrange these digits in descending order to maximize the number, ensuring that the last digit is even. The largest possible even number is 542


Find the diagonal mentod of two digit and three digit number?

find the diagonal method of two digit number and three digit number


Find the largest palindrome made from the product of two 3-digit numbers?

906609=913*993 I found this using a relatively simple computer program that I wrote.


Find the difference between the largest and smallest 2-digits number?

The smallest two digit number is 00 (a number used as a wire gauge) and the largest is 99, so the difference between the largest and smallest 2-digits numbers is 99 (99 - 00)


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 that would find the count of occurrence of largest digit in the input number?

#include#includevoid 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:68596999Largest Digit is = 9Occurence of Largest Digit 9 is = 4


What is 1's complement of decimal 10?

The decimal complement of the number 1 is 8. You can find the complement of any digit by subtracting it from the largest single digit value in the base that you're working in.