made the corrections, still not compiling | Member | | Join Date: Feb 2007
Posts: 33
| |
i have made the corrections as u directed but still is not compiling. not reading the header files. i still think the compiler is not complete. what do u think.
i need ur help.what about sending a compiler to {removed (against site rules)}
below is the corrected code - /* programe to solve mr jones problem. by odo emeka */
-
-
#include <stdio.h>
-
#include <stdlib.h>
-
#include <time.h>
-
-
int main()
-
{
-
-
int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
-
float ppst, mnh;
-
srand(time(NULL));
-
-
printf("Enter Number of workers:");
-
scanf("%d", &nows);
-
printf("Enter fixed cost:");
-
scanf("%d", &fixc);
-
if(nows>24)
-
printf("Enter Number less than or equal to 24");
-
else
-
printf("\n");
-
-
for(i=1;i<=10;i++)
-
{
-
price = 1000+rand()%2500;
-
if(price<=price++)
-
minprice=price;
-
else
-
minprice = price++;
-
-
-
-
for(j=1;j<=10;j++)
-
{
-
demand = 3000+rand()%5000;
-
if(demand >= demand++)
-
maxdemand = demand;
-
else
-
maxdemand = demand++;
-
if(maxdemand>=4000)
-
totmh = 48;
-
else
-
totmh = 24;
-
}
-
mnh= totmh/nows;
-
ppst= (fixc+minprice)/maxdemand;
-
printf("\n\n");
-
printf("Total number of workers in the company\n",nows);
-
printf("The fixed cost of production = \n", fixc);
-
printf("The variable cost = \n", minprice);
-
printf("The max. demand attracted by the above costs = \n", maxdemand);
-
printf("The total men hour involved in the production = \n", totmh);
-
printf("Total hourly input for each workers = \n",mnh);
-
printf("The price that will attract above max. demand = \n", ppst);
-
}
-
return 0;
-
-
}
| | Lives Here | | Join Date: Sep 2006
Posts: 12,070
| | | re: made the corrections, still not compiling Quote:
Originally Posted by menyki i have made the corrections as u directed but still is not compiling. not reading the header files. i still think the compiler is not complete. what do u think.
i need ur help.what about sending a compiler to {removed (against site rules)}
below is the corrected code - /* programe to solve mr jones problem. by odo emeka */
-
-
#include <stdio.h>
-
#include <stdlib.h>
-
#include <time.h>
-
-
int main()
-
{
-
-
int i, j, nows, fixc, maxdemand, minprice, totmh, price,demand;
-
float ppst, mnh;
-
srand(time(NULL));
-
-
printf("Enter Number of workers:");
-
scanf("%d", &nows);
-
printf("Enter fixed cost:");
-
scanf("%d", &fixc);
-
if(nows>24)
-
printf("Enter Number less than or equal to 24");
-
else
-
printf("\n");
-
-
for(i=1;i<=10;i++)
-
{
-
price = 1000+rand()%2500;
-
if(price<=price++)
-
minprice=price;
-
else
-
minprice = price++;
-
-
-
-
for(j=1;j<=10;j++)
-
{
-
demand = 3000+rand()%5000;
-
if(demand >= demand++)
-
maxdemand = demand;
-
else
-
maxdemand = demand++;
-
if(maxdemand>=4000)
-
totmh = 48;
-
else
-
totmh = 24;
-
}
-
mnh= totmh/nows;
-
ppst= (fixc+minprice)/maxdemand;
-
printf("\n\n");
-
printf("Total number of workers in the company\n",nows);
-
printf("The fixed cost of production = \n", fixc);
-
printf("The variable cost = \n", minprice);
-
printf("The max. demand attracted by the above costs = \n", maxdemand);
-
printf("The total men hour involved in the production = \n", totmh);
-
printf("Total hourly input for each workers = \n",mnh);
-
printf("The price that will attract above max. demand = \n", ppst);
-
}
-
return 0;
-
-
}
What error is it giving?
| | Expert | | Join Date: Nov 2006 Location: UK
Posts: 1,320
| | | re: made the corrections, still not compiling
I compiled your code with Tubro C V3.0, Boralnd C Builder Visual C and gcc without problems - sounds as though your compiler is broken. Try downloading DEV-C++ from
http://www.bloodshed.net/devcpp.html
it is easy to use and you don't have to create a project when implementing single file programs!
|  | | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,295 network members.
|