Sunday 1 November 2015

write a program for the series 1+x+x2+x3+……+xn using loop in c language.

write a program for the series 1+x+x2+x3+……+xn using loop in c language. #include<stdio.h> #include<conio.h> Void m... thumbnail 1 summary


write a program for the series 1+x+x2+x3+……+xn using loop in c language.

#include<stdio.h>
#include<conio.h>
Void main( )
{
            Float series=1;
            Int i,n,x,p=1;
            Printf(“enter the value of n –“);
            Scanf(“%d”,&n);
            Printf(“\n\n enter the value of x :”);
            Scanf(“%d”,&x);
            For(i=o;i<=n;i++)
            {
                        For(j=o;j<=I;j++)
                        {
                                    P=p*x;
                        }
                        Series=series+p;
}
Printf(“series=%f”,series);
}

No comments

Post a Comment