Program to find the percentage of difference between two numbers | Java program to calculate the percentage ; Function to calculate the percentage ; Driver Code ; Function calling
class GFG { static int percent ( int a , int b ) { float result = 0 ; result = ( ( b - a ) * 100 ) / a ; return ( int ) result ; } public static void main ( String [ ] args ) { int a = 20 , b = 25 ; System . out . println ( percent ( a , b ) + " % " ) ; } }