‘while’ statement ??

Home Forums C Programming ‘while’ statement ??

This topic contains 1 reply, has 2 voices, and was last updated by  GWILouisaxwzkla 10 years, 11 months ago.

  • Author
  • #2164

    Hi, as i said i am new to all this computer stuff, I think that if i can see how codes are written a few times, then i can start to understand it better. Please help me to better understand this language.

    Write a C program using a while-statement to compute n factorial (n!) of a nonnegative integer n where
    p = 1 (for n = 0)
    p = double = n*(n-1)*(n-2)*…*2*1 (for n€1)
    „ For example : 5! = 5*4*3*2*1 = 120
    „ Prompt user to enter the value of n, computes
    and prints its factorial (p)

    Best wishes ……..daisy

  • #3490

    could do:

You must be logged in to reply to this topic.