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:
O D D
Definition: A number is odd if it is not divisible by 2.
There are 5000 odd numbers below 10,000.
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.
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.