C program, to calculate Product of Digits of a Number

In this tutorial you will learn about the C program, to calculate Product of Digits of a Number and its application with practical example.

C program to calculate Product of Digits of a Number

In this tutorial, we will learn to create a C program that will calculate the Product of Digits of a Number using C programming.

Prerequisites

Before starting with this tutorial, we assume that you are the best aware of the following C programming topics:

  • Operators in C Programming.
  • Basic Input and Output function in C Programming.
  • Basic C programming.
  • While Loop in C programming.
  • Conditional Statements in C programming.
  • Arithmetic operations in C Programming.

Algorithm:-

Calculate the Product of Digits of a number:-

In this program, we will take the input number from the user. Then we will pass that number to a while loop to break it down. Then we will use arithmetic statements to find the digits from that number. After that, we will find the product of the digits. At last, we will print the product of the digits to the user.

With the help of the below program, we can find a product of the digits in a number.

Program Code:-

 

Output:-

In the above program, we have first initialized the required variable.

  • no = it will hold the integer value for the input.
  • i = it will hold the integer value for the controlling of the loop.
  • rem = it will hold the integer value for the reminder.
  • prod = it will hold the integer value for the product.

Taking the input amount from the user.

Converting the notes for the amount.

Printing output.

In this tutorial we have learn about the C program, to calculate Product of Digits of a Number and its application with practical example. I hope you will like this tutorial.