Wrong answer in ACPC 10A problem in spoj

I am getting WA in Spoj problem http://www.spoj.com/problems/ACPC10A/

  int main()
  {

   int a,b,c;
   cin>>a>>b>>c;
   while(a!=0&&b!=0&&c!=0)
     {
     if((2*b)==(a+c))
        cout<<"AP "<<c+(c-b)<<"\n";

    else if((b*b)==(a*c))
        cout<<"GP "<<c*(c/b)<<"\n";
     cin>>a>>b>>c;
     }
     return 0;
    }

What will be the output for -5 0 5??.. it gives nothing because the condition in the while statements evaluates to (1 && 0 && 1) which is 0, so it prints nothing but that is a valid AP , you need to change the while statement condition

//