Search
 
SCRIPT & CODE EXAMPLE
 

CPP

how to find product of a given numbers in c++

#include<iostream>

using namespace std;

int main()
{
	int number, reminder, digitProduct = 1;
	
	cout << "
Please Enter the Number to find the Digits Product =  ";
	cin >> number;
	
	while (number > 0)
	{
    	reminder = number % 10;
    	digitProduct = digitProduct * reminder;
    	number = number / 10;
    	
    	cout << "
Digit = " << reminder << " and the Digit Product = " << digitProduct;
	}
	cout << "

The Product of all Digits in a given Number = " << digitProduct;
		
 	return 0;
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: what is throw in c++ 
Cpp :: Program to print full pyramid using 
Cpp :: c++ for loop syntax 
Cpp :: c++ convert to assembly language 
Cpp :: C++ program to print all possible substrings of a given string 
Cpp :: clear map in C++ 
Cpp :: ifstream 
Cpp :: what is the time complexitry of std::sort 
Cpp :: C++ vector at() method 
Cpp :: cpp vector structure 
Cpp :: custom slider cpt wordpress theme 
Cpp :: convert single character string to char c++ 
Cpp :: array of charcter c++ 
Cpp :: Shell-Sort C++ 
Cpp :: << in C++ 
Cpp :: binary tree 
Cpp :: bitmap 
Cpp :: visual studio code terminal keeps closing c++ 
Cpp :: C++ ss 
Cpp :: c++ convert int to string with a fixed number of digits 
Cpp :: c++ *agrs 
Cpp :: use textchanged qt cpp 
Cpp :: c++ write number to registry 
Cpp :: const in c++ is same as globle in python 
Cpp :: argsort c++ 
Cpp :: vowel and consonant program in c++ using if else 
Cpp :: Link List Insertion a node 
Cpp :: PCL normal specific point 
Cpp :: Write a CPP program to calculate sum of first N natural numbers 
Cpp :: distinct numbers cses 
ADD CONTENT
Topic
Content
Source link
Name
1+5 =