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 is double pointer in c?

1026


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2122


to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?

2162


What is the newline escape sequence?

1062


Explain the red-black trees?

1110


What is a floating point in c?

1062


how to capitalise first letter of each word in a given string?

1910


The difference between printf and fprintf is ?

1265


List a few unconditional control statement in c.

972


What is the use of linkage in c language?

1045


Is register a keyword in c?

1029


Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

1085


Do character constants represent numerical values?

1321


What is function prototype in c language?

1019


Can a void pointer point to a function?

1007