write a program where an array of integers, e.g.{10203004567000} is given, you have to create a new array which will be like (12345670000000}, without using any other temporary array.
Given an integer n, write a function that returns count of trailing zeroes in n!. Examples: Input: n = 5 Output: 1 Factorial of 5 is 20 which has one trailing 0. Input: n = 20 Output: 4 Factorial of 20 is 2432902008176640000 which has 4 trailing zeroes. Input: n = 100 Output: 24
int main()
ReplyDelete{
int [] array = {0,0,2,0,3,0,0,4,5,6,7,0,0,8};
int hole = 0;
for (int j = 0; j < array.Length; j++)
{
if (array[j] != 0)
{
array[hole++] = array[j];
array[j] = 0;
}
}
}