i got ur code.i saw some mistakes in ur code.
First of all u r going to get the result in float.So u have to properly typecast where ever needed.
i have made some modifications in ur code.Now try this code.If this also dont work,send me the error messages you get.ok.have a nice time
#include
#define SIZE 10
void chart (int p[], int r[]);
void int main()
{
int range[SIZE]={0};
int sales[20]=
{ 267, 359, 468, 525, 678, 710, 856, 867, 920, 1067,
254, 987, 1034, 875, 345, 765, 234, 500, 300, 490};
int p[20];
for( int i=0; i<14; i++)
{
p[i]= (int)(200+.09*sales[i]);
}
printf("%7d%13d ", i,sales[i]);
chart(p, r);
}
void chart ( int p[], int r[])
{
int r[10]={0};
for( int i= 0; i<14; i++)
{
if ( p[i] >0 && p[i] <200)
{
++ r[0];
}
else if (p[i] >=200 && p[i] <300){
++ r[1];
}
else if (p[i] >=300 && p[i] <400){
++ r[2];
}
else if (p[i] >=400 && p[i] <500){
++ r[3];
}
else if (p[i] >=500 && p[i] <600){
++ r[4];
}
else if (p[i] >=600 && p[i] <700){
++ r[5];
}
else if (p[i] >=700 && p[i] <800){
++ r[6];
}
else if (p[i] >=800 && p[i] <900){
++ r[7];
}
else if (p[i] >=900 && p[i] <1000){
++ r[8];
}
else {
++ r[9];
}
}
}
for( int i=0; i<=size; i++)
{
printf("%7d%13d ",i, r[i]);
}