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
hey..it s simple..make use of built-in function isdigit(character)..it s in stdlib.h...
syntax error
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.
You can create a Shell script to find the smallest digit of a number by iterating through its digits. Here's a simple example: #!/bin/bash read -p "Enter a number: " number smallest=9 for (( i=0; i<${#number}; i++ )); do digit=${number:$i:1} if (( digit < smallest )); then smallest=$digit fi done echo "The smallest digit is: $smallest" This script prompts the user for a number, checks each digit, and prints the smallest one.
write an assembly language program to find sum of N numbers
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:
Write a c program to compute the surface area and volume of a cube