#WSQ09

Hello again, I was too busy for doing post, but now I have some time for doing some posts. Well for this WSQ we where ask for this:

“Create a program that asks the user for a non-negative integer (let’s call that number n) and display for them the value of n! (n factorial).

After showing them the answer, ask them if they would like to try another number (with a simple y/n response) and either ask again (for y) or quit the program and wish them a nice day (if they answered n).”

Well solving this problem was very simple. Fist what I did was to declare two variables, fac and x. Fac is for the number and x if for a yes or not. Then we ask for the first value, the number. And then we call the function.

Captura de pantalla 2016-03-08 a las 12.13.49 p.m.Captura de pantalla 2016-03-08 a las 12.13.59 p.m.

Here is the link for you to download my code and play with it: https://www.dropbox.com/s/idgvdui4oy2djof/fac.c?dl=0

 

CC BY-SA 4.0 #WSQ09 by manuelch96 is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.