import java.io.*; class commondifference { public static void main(String args[]) throws Exception { int f=1,d=0,d2=0,n,r,r2; BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); System.out.println("ENTER a number"); n=Integer.parseInt(br.readLine()); do { r=n%10; r2=(n/10)%10; d=r-r2; if(d2==0||d2==d) d2=d; else if (d2!=d) { f=2; break; } n=n/10; }while(n>9); if(f==2) System.out.println("No Common Difference"); else System.out.println("Common difference is" + d2); } }
this is a net web blog journal diary that is formed and made by a Indian student for faculty,college kids,children and youngsters as a gift for you to hold and carry everywhere and everyplace around the globe.This journal is completely and totally free from price to use and is extremely easy to use and very easy to understand.