Program to find the percentage of difference between two numbers | C ++ program to calculate the percentage ; Function to calculate the percentage ; Driver Code . ; Function calling
#include <iostream> NEW_LINE using namespace std ; int percent ( int a , int b ) { float result = 0 ; result = ( ( b - a ) * 100 ) / a ; return result ; } int main ( ) { int a = 20 , b = 25 ; cout << percent ( a , b ) << " % " ; return 0 ; }