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 / rahul

#include <stdio.h>
#include <math.h>


main()
{
int num,rem,qot,prod;
printf("enter the number ");
scanf("%d",&num);
prod=1;
while((num/10)>0)
{
rem=num%10;
prod=prod*rem;
num=(num-rem)/10;
}
printf("product is %d",prod);
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are run-time errors?

1054


What is the difference between declaring a variable and defining a variable?

1185


What is the basic structure of c?

1010


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1057


Is c is a high level language?

1127


What is pragma c?

1059


What is the purpose of scanf() and printf() functions?

1173


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

1021


Define circular linked list.

975


What is a pragma?

1077


Tell us the use of fflush() function in c language?

1087


given post order,in order construct the corresponding binary tree

2724


What is c value paradox explain?

1019


What are qualifiers?

976


explain what is fifo?

1027