Computer Science, asked by shreeparnagupta3, 5 hours ago

in c++ wap to input a number and print the product of it's digits using while loop programs​

Answers

Answered by nitishshaw720
0

Answer:

C++ programming

Explanation:

// C++ program to compute

// product of digits in the number.

#include<bits/stdc++.h>

using namespace std;

/* Function to get product of digits */

int getProduct(int n)

{

int product = 1;

while (n != 0)

{

product = product * (n % 10);

n = n / 10;

}

return product;

}

// Driver program

int main()

{

int n = 4513;

cout << (getProduct(n));

}

Similar questions