answersLogoWhite

0

#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

14y ago

Still curious? Ask our experts.

Chat with our AI personalities

MaxineMaxine
I respect you enough to keep it real.
Chat with Maxine
SteveSteve
Knowledge is a journey, you know? We'll get there.
Chat with Steve
ProfessorProfessor
I will give you the most educated answer.
Chat with Professor

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