Code is right. Execution is wrong! HELP
Hello everyone,
This program is used to calculate the discount on a given number given its discount rate.
Code:
#include <stdio.h>
int main ()
{
int n, percent, intresult = 0 , result = 0 ;
printf ("Enter the number\n\n") ;
scanf ("%i", &n) ;
printf ("\n\nLess %% ?\n\n") ;
scanf ("%i", &percent) ;
intresult = (percent / 100) * n ;
result = n - intresult ;
printf ("\n\nTotal = %i\n\n", result) ;
getchar () ;
return 0 ;
}
The result that am getting is the number typed in by the user itself.
There is no calculation happening on the number.
Please help