11:32 PM C Programming Sheet - 10 |
#include"stdio.h"
main()
{
int y, z, p=1, n, i;
printf("enter z and n : ");
scanf("%d%d", &z, &n);
y=0;
for(i=1;i<=n;i++){
p*=z;
y+=p;
}
printf("Y = %d", y);
getch();
}
|
|
Total comments: 0 | |