C PROGRAMLAMA (faktöriyel hesabı yapan program kodu)


C Programlama dilinde hazırlanan bir sayının faktöriyelini alan program kodu aşağıdaki gibidir.

#include <stdio.h>
#include <stdlib.h>

int main()
{
   int sayi,fakt=1,i=1;

   printf("\n\nFaktoriyelini istediginiz sayiyi giriniz :");
   scanf("%d",&sayi);

   while(i<=sayi)
   {
       fakt=fakt*i;
       i++;
   }

    printf("\n\nsonuc= %d ",fakt);
    getch();
}




SHARE

Milan Tomic

Hi. I’m Designer of Blog Magic. I’m CEO/Founder of ThemeXpose. I’m Creative Art Director, Web Designer, UI/UX Designer, Interaction Designer, Industrial Designer, Web Developer, Business Enthusiast, StartUp Enthusiast, Speaker, Writer and Photographer. Inspired to make things looks better.

    Blogger Comment
    Facebook Comment

0 yorum :

Yorum Gönder