Write a program to input and print the largest digits
Answers
Answered by
0
Answer:
Program to convert Number in Characters
- #include<stdio.h>
- #include<stdlib.h>
- int main(){
- long int n,sum=0,r;
- system("cls");
- printf("enter the number=");
- scanf("%ld",&n);
- while(n>0)
Answered by
1
Answer:
Hi friend, this is what I found on Google.
Explanation:
#include <stdio.h>
int main() {
int num, large = 0, rem = 0;
/* get the input from the user */
printf("Enter your input value:");
scanf("%d", &num);
/* finding the largest digit of the given input */
while (num > 0) {
rem = num % 10;
if (rem > large) {
large = rem;
}
num = num / 10;
}
/* print the largest digit of the number */
printf("Largest digit of the number is %d\n", large);
return 0;
}
Mark me as the brainliest !!!☺️☺️
Similar questions