answersLogoWhite

0


Best Answer

#include
#include
void main()
{
int a,b;
clrscr();
printf("Enter 2 numbers:");
scanf("%d %d",&a,&b);
if(a>b)
printf("%d is greater than %d",a,b);
else
printf("%d is greater than %d",b,a);
getch();
}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

int largest_digit (int n)

{

int last, tmp;

if (n<10) return n;

last= n/10;

tmp= largest_digit (n/10);

if (last>tmp) tmp= last;

return tmp;

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program to find largest digit in 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.


What is the largest 2 digit number that is a factor of 3375?

To find the largest 2-digit number that is a factor of 3375, we need to factorize 3375 into its prime factors. 3375 can be expressed as 3^3 * 5^3. To find the largest 2-digit number that is a factor, we need to consider the factors that are multiples of both 3 and 5. The largest 2-digit number that fits this criteria is 75, which is 3 * 5^2.


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 sum of the smallest and biggest two-digit composite numbers?

The smallest two-digit composite number is 10, which is the product of 2 and 5. The largest two-digit composite number is 99, which is the product of 3 and 33. To find the sum of the smallest and largest two-digit composite numbers, we add 10 and 99, resulting in 109.


C program to find the largest digit of a number?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; main() { int n,max=0,rem; printf("\n enter a number"); scanf("%d",&amp;n); while(n!=0) { rem=n%10; n=n/10; if(rem&gt;max) { max=rem: }} printf("\n the largest digit is: %d",max); getch(); }


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.


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

Write your own prime number program and find out.