Tuesday, November 27, 2018

C code review shows xcos series of user entered number-of-series

This C code shows how to shows xcos series of user entered number-of-series. And code is helpful while user is in between mathematical manipulation task.

code:

//Tested Ok on Code::Blokcs IDE 17.12.
//shows xcos series of user entered number-of-series

# include <stdio.h>
//# include <conio.h>

main()
{
    int i,p,n;
   // clrscr();
    printf("\nenter the number in term of series:\n\t");
    scanf("%d",&n);
    printf("\n\t xcos(x)=1");
    for(i=1; i<=n; i++)
    {
        p=2*i;
        if(i%2==0)
            printf("+");
        else
            printf("-");
        printf("x^%d/%d!",p,p);
        getch();
    }
}

//end of program

To see such C code reviews refer blog archieve at right side or click CCode lable for till posted posts list.

...till next post, bye-bye and take care.

No comments:

Post a Comment