hi, I'm trying to calculate the percentage of an ammount of boxes in C. Ex: 4400.
I have the next code:
#include<iostream.h>
#include<conio.h>
main()
{
double a=2400;
double b=8000;
double per=0;
per=2400*100/8000;
cout<<per;
getch();
}
and return a negative value. I try to asign values at differents variables like:
double confused=241541;
double moreconfused=145621;
long int percf=1452145;
cout<<confused<<endl<<moreconfused<<percf;
and return negatives values too,
please, somebody can help me?