problem statement is here
#include<stdio.h>
int main()
{
int a,b,c,n,d,r,p,l;
while(1)
{
scanf("%d %d %d",&a,&b,&c);
if(a==0&&b==0&&c==0)
break;
else
{
l=(c-b)/(b-a);
if(l==1)
{
d=c-b;
n=c+d;
printf("AP %d\n",n);
}
else
{
r=c/b;
p=c*r;
printf("GP %d\n",p);
}
}
}
return 0;
}
No comments:
Post a Comment