Login

Create Account
+14156709189
info@expertsmind.com
Submit Homework/Assignment
Get quote & make Payment
Get Solution
Find error for curious number, Data Structure & Algorithms
#include
#include
int sumFact(int numb);
int calculateFactorial(int digit);
main()
{
int numb, sumfact;
do{
printf ("Enter a number 1 to 9999\n");
scanf("%d", numb);
printf("\n");
}
while (!(numb >= 1 && numb <=9999));
sumfact = sumFact(numb);
if (numb == sumfact)
{
printf("\nThe Number %d you entered is curious number", numb);
}
else
{
printf("\n not a curious number", numb);
}
}
int sumFact (int numb)
{
int rightdigit, sumfact = 0;
while (numb != 0)
{
rightdigit = numb%10;
numb = numb /10;
sumfact = sumfact + calculateFactorial (rightdigit);
}
return sumfact;
}
int calculateFactorial (int digit)
{
int factval;
if ((digit == 0 ) && (digit == 1))
{
return (1);
}
else
{
factval = digit*calculateFactorial (digit1);
return factval;
}
}
Posted Date: 3/16/2013 4:55:04 PM  Location : United Arab Emirates
Ask an Expert
Related Discussions:
Find error for curious number, Assignment Help, Ask Question on Find error for curious number, Get Answer, Expert's Help, Find error for curious number Discussions
Write discussion on Find error for curious number
Your posts are moderated
Write your message here..
Related Questions
Advantage of list over arrays, The advantage of list over Arrays is flexibi...
The advantage of list over Arrays is flexibility. Over flood is not a problem until the computer memory is bushed. When the individual record are quite large, it may be difficult t
Characteristics of good algorithms, What do we mean by algorithm? What are ...
What do we mean by algorithm? What are the characteristics of a good and relevant algorithm? An algorithm is "a stepbystep procedure for finishing some task'' An algorithm c
Undirected graph and adjacency matrix, Q. Consider the specification writte...
Q. Consider the specification written below of a graph G V(G ) = {1,2,3,4} E(G ) = {(1,2), (1,3), (3,3), (3,4), (4,1)} (i) Draw the undirected graph. (
Big o notation, This notation gives an upper bound for a function to within...
This notation gives an upper bound for a function to within a constant factor. Given Figure illustrates the plot of f(n) = O(g(n)) depend on big O notation. We write f(n) = O(g(n))
Different ways for representing s graph, W h at are the different ways by...
W h at are the different ways by which we can represent graph? Represent the graph drawn below using those ways. T he d iff e r e nt w a y s by
Applications of linear and binary search, The searching method are applicab...
The searching method are applicable to a number of places in current's world, may it be Internet, search engines, text pattern matching, on line enquiry, finding a record from data
Programs, Develop a program that accepts the car registration( hint: LEA 43...
Develop a program that accepts the car registration( hint: LEA 43242010)
Doubly linklist, explanation of doubly linklist
explanation of doubly linklist
Simulation of queues, Simulation is the process of making an abstract model...
Simulation is the process of making an abstract model of a real world situation in order to be aware of the effect of modifications and alterations and the effect of introducing nu
Arrays, Data array A has data series from 1,000,000 to 1 with step size 1, ...
Data array A has data series from 1,000,000 to 1 with step size 1, which is in perfect decreasing order. Data array B has data series from 1 to 1,000,000, which is in random order.
Assignment Help
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
IT Courses and Help
ExpertsMind Services
Online Tutoring
Projects Assistance
Exam Preparation
Coursework Help
Programming Courses
Engineering Courses
Why Us ?
~Experienced Tutors
~24x7 hrs Support
~Plagiarism Free
~Quality of Work
~Time on Delivery
~Privacy of Work