answersLogoWhite

0


Best Answer

Assuming the number is represented by a decimal integer, initialise a counter to zero, then repeatedly divide the number by 10 and until the number is zero. After each division, examine the remainder. Each time the remainder is zero, increment the counter.

If the number is represented by a decimal float, repeatedly multiply by 10 until the value is an integer, then perform the previous algorithm.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you write a program to find number of zeros for the given number in c program?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

C program to display a number entered by user as it is without skipping the zeros preceding the number?

// Define and initialize input buffer char inputBuffer[256]; memset(inputBuffer, '\0', 256); // Get input scanf("%s", inputBuffer); // Display exactly what the user typed in printf("%s\n", inputBuffer);


How do you write a program to find the reverse of a given number in COBOL?

Identification Division.Program-id. Example1.Data Division.Working-storage Section.01 Num1 Pic 999 Value Zeros.01 Num2 Pic 9 Value Zeros.01 Num3 Pic 99 Value 10.01 Result Pic 999 Value Zeros.01 Temp Pic 99.Procedure Division.Calculator.Display "enter First Number :".Accept Num1.Perform Until Num1 = 0Divide Num1 By Num3 Giving Temp Remainder Num2Compute Result =(result * Num3) + Num2Compute Num1 = Num1 / Num3End-performDisplay "result Is=", Result.Stop Run.


Write a program to find the reverse of a given number with help of function?

//Reverse of the Number #include<stdio.h> #include<conio.h> int main () { int num,mod,rev=0; printf("Enter a number:"); scanf("%d", &num); while (num>0) { mod=num%10; rev=(rev*10)+mod; num=num/10; } printf("Reverse of the given number: %d", rev); getchar(); return 0; } // alternative solution based on reversing the alphanumeric representation of // the number: void rev(int me) { char alpha[32]; sprintf(alpha, "%d", me); for (const char* cp = alpha + strlen(alpha) - 1; cp >= alpha; --cp) { putchar(cp); } }


You can determine quickly the effect of adding poles and zeros by?

Root locus


How to write printf statements for print 1.234 in a 9-digit field with preceding zeros?

#include<stdio.h> #include<conio.h> void main() { char b=0; float a; clrscr(); a=1.234; printf("\n%d%d%d%d%.3f",b,b,b,b,a); getch(); }

Related questions

How do you write a googol of zeros?

Seeing as a googol of zeros would be 10^100 zeros, that number of zeros would be quite hard to write out. If you were to try and write out that many zeros by hand at 3 zeros per second, it would still take you 1.05699307 × 1092 years to write them all out.


How do you write the number 200000000000000000000 in words?

2*1020 this is called 200quintillion a quintillion is a number with 18 zeros a sextillion is a number with 21 zeros your number has 20 zeros therefore it is not quite a sextillion yet.


How do you write one googol in numerals?

The number is spelled googol. To write it in number format, write a 1, followed by one hundred zeros.


The number with 54 hundreds and 7 units altogether is?

When given x number of hundreds, simply write the number followed by two zeros. So, 54 hundreds is 5400. When added to seven, this will be equal to 5407.


Include zeros in 2.25 million?

Million is the name given to a number with 7 digits in front of the decimal place. In order to write out any number take the number you are given and and move the decimal place to the right until you have 7 digits in front of the decimal. add zeros to the end until it has 7 digits in front of the decimal place. So 2.25 million would be 2,250,000.


What is the name is given to a number with 1 followed by 48 zeros?

A quindecillion.


What name is given to a number with 1 followed by 100 zeros?

It is called a Googol.


How do you say the write the number 70 000 000 000 000 000 000 000?

70 sextillion sextillion is a number with 21 zeros septillion is a number with 24 zeros your number has 22 zeros. it is not quite a septillion but it falls in the category of a sextillion


How do you write 6million in numbers?

Six million as a number has six zeros 6,000,000.


Is sexgintillion a number and how is it a number?

Yes it is a number it is a number because that is the name somebody has given to 1 followed by 183 zeros


How do you write 8333 million in number form?

To write 8333 million in number form just add six zeros, like this 8,333,000,000


A pupil wrote 2002 instead of 20002. find his error?

He did not write 3 zeros in the middle of the number. Instead, he wrote 2 zeros.