[My site ]
Main » 2013 » December » 12 » C Programming Sheet - 10
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();
}
Category: C Programming - 1 | Views: 350 | Added by: ahansaary | Rating: 0.0/0
Total comments: 0
Only registered users can add comments.
[ Sign Up | Login ]