inline int getNumDigits(const int n) {
return ((int) log10(n) + 1);
}
#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
Count them unless the number has a recurring ending.
write a vb program to find the magic square
syntax error
hey..it s simple..make use of built-in function isdigit(character)..it s in stdlib.h...
For first find an example program.
Write a program to find the grade obtained by the students of a class
Yes, do write. That's what you always have to do when you have got a homework-program.
write an assembly language program to find sum of N numbers
If you want to find out the answer to the question you have to count or basicaly just divide by 10.....
Write a c program to compute the surface area and volume of a cube
from google :To write a number in scientific notation:Put the decimal after the first digit and drop the zeroes. In the number 123,000,000,000 The coefficient will be 1.23To find the exponent count the number of places from the decimal to the end of the number.In 123,000,000,000 there are 11 places. Therefore we write 123,000,000,000 as: