made the corrections, still not compiling

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • menyki
    New Member
    • Feb 2007
    • 33

    made the corrections, still not compiling

    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


    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;
     
    }
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    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


    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?

    Comment

    • horace1
      Recognized Expert Top Contributor
      • Nov 2006
      • 1510

      #3
      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.n et/devcpp.html
      it is easy to use and you don't have to create a project when implementing single file programs!

      Comment

      Working...