Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

Write an algorithm for a program that receives an integer as
input and outputs
the product of of its digits. E.g. 1234 = 24, 705 = 0

Answer Posted / abhisekh_banerjee

/* To get an number as input and add the digits of that number*/
#include<stdio.h>
#include<conio.h>
int main(void)
{
int a,b,c=1,i;
clrscr();
printf("Enter the number : ");
scanf("%d",&a);
for(i=0;a>0;i++)
{
b=a%10;
a=a/10;
c=c*b;
}
printf("\n%d",c);
return 0;
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is null pointer constant?

160


What is realloc in c?

190


What is the use of #define preprocessor in c?

177


write a c program to do the following: a) To find the area of a triangle. b) To convert the temperature from Fahrenheit to Celsius. c) To convert the time in hours : minutes : seconds to seconds.

1120


What is a pointer on a pointer in c programming language?

208






What is the use of void pointer and null pointer in c language?

195


How can I get the current date or time of day in a c program?

212


How can I implement sets or arrays of bits?

205


What are different storage class specifiers in c?

205


Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff

1541


When should I declare a function?

235


What is mean by data types in c?

167


What is the newline escape sequence?

202


In C programming, how do you insert quote characters (ā€˜ and ā€œ) into the output screen?

328


What is wrong in this statement? scanf(ā€œ%dā€,whatnumber);

243