CSE 102 Homework #3 solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (1 vote)

In this homework you will improve your skills in conditions, loops and functions in C programming. Submit your homework via KADI system.
You will wite a program which asks users for an integer and checks if the number is an odd, a factorial or a narcissistic number, depending on the user choice. The program will keep running until the user wants to exit by entering y. Example run of the program should look like:
ODD Definition: A number is odd if it is not divisible by 2. Numbers that are not odd are even. Compare with another pair — evil and odious numbers. First ten: 1, 3, 5, 7, 9, 11, 13, 15, 17, 19 There are 5000 odd numbers below 10,000.
FACTORIAL Definition: The n-th factorial is the product of the first n natural numbers. The factorial deserved an exclamation mark for its notation: k! = 1*2*3*…*k. First ten: 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 3628800 There are 7 factorials below 10,000.
NARCISSISTIC Definition: A k-digit number n is called narcissistic if it is equal to the sum of k-th powers of its digits. They are also called Plus Perfect numbers. First ten: 1, 2, 3, 4, 5, 6, 7, 8, 9, 153 There are 16 narcissistic numbers below 10,000.
 Submit a whole program, i.e. including your helper functions and the main function.  There will be no automatic testing on KADI for this homework. Therefore, formatting details such as spaces and alignment are not important. However, your program should work exactly as the example run given above.  Use the structures you learned such as loops, conditions and functions whenever needed. The usage of these structures is as important as the correct execution of your program.  The assignment must be your original work. Duplicate or very similar assignments are both going to be considered as cheating.  Ask your questions via moodle.