How to determine given sequence is AP/GP



#include<stdio.h>
#include<conio.h>

int main()
{   
    int i,m,n,k; 
    int sequence[] = {1,2,5,7,9,13,98};
    
    //CHECK FOR GP 
     for(i=0;i<5;i++)
     { 
        k = sequence[i+1] % sequence;
     } 
     printf("common factor is %d\n",k);
     
     if(k == 0)
     {
          printf("The sequence is Geometric Progression\n");
     }
     else
     {
          printf("The sequence is NOT Geometric Progression\n \n \n");
     }     
    
    //check for AP
     m = sequence[i+1] - sequence;
     n = sequence[i+2] - sequence[i+1];
     
     printf("The common difference between 1st & 2nd and 2nd &3rd consecutive terms is %d and %d\n",m,n);
     
     if(m==n)
     {
     printf("The sequence is Arithmatic Progression\n");
     }
     else
     {
     printf("The sequence is NOT Arithmatic Progression\n");
     }     
    getch();
}