#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
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);
write a c++ program to convert binary number to decimal number by using while statement
int lastLargestIndex(int a[],int n) //a=array, n= number of elements in array { int max=a[0],maxp=0; //max=largest no., maxp= position of largest no. for(int i=0;i<n;i++) if(a[i]>=max) { max=a[i]; maxp=i; } return maxp; }
write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program
how to write a program that counts automorphic number from 1 to 999
Write your own prime number program and find out.
Write a program to convert a 2-digit BCD number into hexadecimal
There is no largest number. You can just keep going.
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);
No.
infinity
WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL
I was confused by the occurrence of rain every afternoon this week.
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.
874321 is the largest number made from all these digits.
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.