Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 are pragmas and what are they good for?

945


What is a structure member in c?

961


What is the difference between ++a and a++?

1159


Why we use break in c?

946


Explain the difference between the local variable and global variable in c?

1035


difference between Low, Middle, High Level languages in c ?

2035


Why is c called c?

973


Why header file is used in c?

1036


Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me

1909


Explain do array subscripts always start with zero?

1189


What is variable declaration and definition in c?

866


Why do some versions of toupper act strangely if given an upper-case letter?

1046


When would you use a pointer to a function?

1003


Explain how can you restore a redirected standard stream?

1049


What is graph in c?

1022