Computer Science, asked by inayat15, 1 year ago

answer it fast using ' for' . plz it's urgent

fast!

Attachments:

Answers

Answered by garywalter1221
0

#include<stdio.h>

#include<conio.h>

#include<math.h>

void main()

{

int i,n;

float x,sum=0;

clrscr();

printf(“1+x+x^2+……+x^n”);

printf(“\nEnter the value of x and n:”);

scanf(“%f%d”,&x,&n);

for(i=1;i<=n;++i)

sum+=pow(x,i);

sum++;

printf(“nSum=%f”,sum);

getch();

}

Similar questions