Driver Code
static public void Main ( ) { int [ ] set1 = { 1 , 7 , 10 , 13 , 14 , 19 } ; int n1 = set1 . Length ; Console . WriteLine ( lenghtOfLongestAP ( set1 , n1 ) ) ; int [ ] set2 = { 1 , 7 , 10 , 15 , 27 , 29 } ; int n2 = set2 . Length ; Console . WriteLine ( lenghtOfLongestAP ( set2 , n2 ) ) ; int [ ] set3 = { 2 , 4 , 6 , 8 , 10 } ; int n3 = set3 . Length ; Console . WriteLine ( lenghtOfLongestAP ( set3 , n3 ) ) ; } }