Computer for SEE and NEB

It is a complete SEE and NEB solution for computer science. It includes Computer Fundamentals, Database (SQL), Programming in C QBASIC, CSS, JavaScript, and PHP for beginners.

Breaking

Post Top Ad

Your Ad Spot

Friday, August 12, 2022

C program to calculate and display the product of the input digit.

 C program to calculate and display the product of the input digit.



#include <stdio.h>

#include<conio.h>

int main()

{

    int n, p=1;

    printf("Enter any number: ");

    scanf("%d", &n);

    while(n != 0)

    {

        p = p * (n % 10);

        n = n / 10;

    }

    printf("Product of digits = %ld", p);

    getch();

}

No comments:

Post a Comment

Post Top Ad

Your Ad Spot

Pages