473,842 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

the list of the errors as u requested

33 New Member
error c: ......line 3: unable to open include file 'stdio.h
error c: ....... line 4: unable to open include file 'stdlib.h'
error c: ........line 5: unable to open include file 'time.h'
error c: ........line 12: unidentified symbol 'null' in function intmain
error c:.........line 24: unidentified symbol 'price' in function intmain
error c:.........line 24: invalid indirection in function intmain
error c: .......line 25: statement missing ; in function intmain
error c: .......line 27: misplace else in function intmain
error c:........line 28: invalid indirection in function intmain
warning c: ...line 32: code has no effect in function intmain
error c: ..... line 32: for statement missing ; in function intmain
warning c:...line 45:possible use of 'minprice' before definition in function intmain
warning c:..line 45:possible use of 'maxdemand' before definition in function intmain
warning c:..line 50: possible use of 'minprice' before definition in function intmain
warning c:...line 51:possible use of 'maxdemand' before definition in function intmain
warning c:...line 52:possible use of 'totmh' before definition in function intmain
error c: .......line 53:undefined symbol 'mnh' in function intmain
error c: ........line 56: undefined symbol 'return' in function intmain
warning c:....line 56: code has no effect in function intmain
error c:.......line 56: statement missing ; in function intmain
error c: ......line 59: compound statement missing } in function intmain
error c: ...... line 60: compound statement missing } in function intmain

the above are the list of the errors. the code is as shown below again. please, i need the reply urgently.
thank u very much for the effort so far. hope u will look into my problem critically


Expand|Select|Wrap|Line Numbers
  1. /* programe to solve mr jones problem. by odo emeka*/
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. intmain()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh;
  11.     float ppst, mnh;
  12.     srand (time(null) );
  13.  
  14.     printf("Enter Number of workers:");
  15.     scanf("%d", &nows);
  16.     printf("Enter fixed cost:");
  17.     scanf("%d", &fixc);
  18.         if(nows>24)
  19.             printf("Enter Number less than or equal to 24");
  20.         else
  21.             printf("\n");
  22.  
  23.     for(i=1;i<=10;i++){
  24.         price[i] = 1000+(rand()%2500)
  25.             if(price[i]<=price[i++]
  26.                 minprice=price[i];
  27.             else
  28.                 minprice = price[i++];
  29.  
  30.     {
  31.  
  32.     for(j=1,j<=10,j++){
  33.         demand[j] = 3000+(rand()%5000
  34.             if(demand[j] >= demand[j++])
  35.                 maxdemand = demand[j];
  36.             else
  37.                 maxdemand = demand[j++];
  38.                     if(maxdemand>=4000)
  39.                         totmh = 48;
  40.                     else
  41.                         totmh = 24;
  42.     }
  43.  
  44.     mnh = totmh/nows;
  45.     ppst = (fixc+minprice)/maxdemand;
  46.  
  47.     printf("\n\n");
  48.     printf("Total number of workers in the company\n",nows);
  49.     printf("The fixed cost of production = \n", fixc);
  50.     printf("The variable cost = \n", minprice);
  51.     printf("The max. demand attracted by the above costs = \n", maxdemand);
  52.     printf("The total men hour involved in the production = \n", totmh);
  53.     printf("Total hourly input for each workers = \n",Mnh,"hours");
  54.     printf("The price that will attract above max. demand = \n", ppst);
  55.  
  56.     Return 0;
  57. }

Feb 15 '07 #1
2 4960
Ganon11
3,652 Recognized Expert Specialist
error c: ......line 3: unable to open include file 'stdio.h
error c: ....... line 4: unable to open include file 'stdlib.h'
error c: ........line 5: unable to open include file 'time.h'
error c: ........line 12: unidentified symbol 'null' in function intmain
error c:.........line 24: unidentified symbol 'price' in function intmain
error c:.........line 24: invalid indirection in function intmain
error c: .......line 25: statement missing ; in function intmain
error c: .......line 27: misplace else in function intmain
error c:........line 28: invalid indirection in function intmain
warning c: ...line 32: code has no effect in function intmain
error c: ..... line 32: for statement missing ; in function intmain
warning c:...line 45:possible use of 'minprice' before definition in function intmain
warning c:..line 45:possible use of 'maxdemand' before definition in function intmain
warning c:..line 50: possible use of 'minprice' before definition in function intmain
warning c:...line 51:possible use of 'maxdemand' before definition in function intmain
warning c:...line 52:possible use of 'totmh' before definition in function intmain
error c: .......line 53:undefined symbol 'mnh' in function intmain
error c: ........line 56: undefined symbol 'return' in function intmain
warning c:....line 56: code has no effect in function intmain
error c:.......line 56: statement missing ; in function intmain
error c: ......line 59: compound statement missing } in function intmain
error c: ...... line 60: compound statement missing } in function intmain

the above are the list of the errors. the code is as shown below again. please, i need the reply urgently.
thank u very much for the effort so far. hope u will look into my problem critically


Expand|Select|Wrap|Line Numbers
  1. /* programe to solve mr jones problem. by odo emeka*/
  2.  
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. intmain()
  8. {
  9.  
  10.     int i, j, nows, fixc, maxdemand, minprice, totmh;
  11.     float ppst, mnh;
  12.     srand (time(null) );
  13.  
  14.     printf("Enter Number of workers:");
  15.     scanf("%d", &nows);
  16.     printf("Enter fixed cost:");
  17.     scanf("%d", &fixc);
  18.         if(nows>24)
  19.             printf("Enter Number less than or equal to 24");
  20.         else
  21.             printf("\n");
  22.  
  23.     for(i=1;i<=10;i++){
  24.         price[i] = 1000+(rand()%2500)
  25.             if(price[i]<=price[i++]
  26.                 minprice=price[i];
  27.             else
  28.                 minprice = price[i++];
  29.  
  30.     {
  31.  
  32.     for(j=1,j<=10,j++){
  33.         demand[j] = 3000+(rand()%5000
  34.             if(demand[j] >= demand[j++])
  35.                 maxdemand = demand[j];
  36.             else
  37.                 maxdemand = demand[j++];
  38.                     if(maxdemand>=4000)
  39.                         totmh = 48;
  40.                     else
  41.                         totmh = 24;
  42.     }
  43.  
  44.     mnh = totmh/nows;
  45.     ppst = (fixc+minprice)/maxdemand;
  46.  
  47.     printf("\n\n");
  48.     printf("Total number of workers in the company\n",nows);
  49.     printf("The fixed cost of production = \n", fixc);
  50.     printf("The variable cost = \n", minprice);
  51.     printf("The max. demand attracted by the above costs = \n", maxdemand);
  52.     printf("The total men hour involved in the production = \n", totmh);
  53.     printf("Total hourly input for each workers = \n",Mnh,"hours");
  54.     printf("The price that will attract above max. demand = \n", ppst);
  55.  
  56.     Return 0;
  57. }

I'll try to settle these errors line by line:

1) Try <cstdio.h>, or <stdio>
2) Try <cstdlib.h>, or <stdlib>
3) Try <ctime.h>, or <time>
The above errors could also be caused by trying to compile a C program in a C++ compiler - check to see that the file has a .c after it rather than a .cpp
4) null should be NULL - C is case sensitive and decided to make the NULL constant capitalized.
5) You never defined a variable named price - was this a mistyping?
6) There is a missing semicolon after the statement on line 24 - this may fix the error.
7) The if...statement is missing an end parentheses ')' after its condition.
8) The else error will be fixed by (7).
9) This open bracket '{' should be an end bracket '}' to end the for...loop.
10) This for...loop header has commas rather than semicolons separating its statements.
11) Same error as (10).
12) Because price is never defined, minprice is set to some garbage value - thus, using it in calculations will produce unexpected results.
13) This error will be fixed when the above corrections have been made.
14) and 15) repeat (12) and (13).

You have capitalized the 'return 0' statement, but 'return' is supposed to be all lowercase. Finally, the function is named intmain, but it should be int main with a space.

Try fixing all of these errors and see if you still get any errors at compilation - if so, come back with a full list, and we can work from there.
Feb 16 '07 #2
rajesh6695
96 New Member
If you are using the TurboC compiler please check that the path of the directories are correct....
Feb 16 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2309
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be fine I think) that will say "I'm sorry but the data you requested cannot be found" or something along those lines.... This code is on an archive page I have on my company's intranet....The end result is to show 3 records at a time pulled from an...
12
10961
by: Brett L. Moore | last post by:
Hi, I have had trouble determining whether the STL list.size() operation is O(1) or O(n). I know the list is a doubly-linked list, so if the size() operation begins at the head, then counts to the end - obviously its O(n). However, keeping track of inserts and deletes isn't that tough, so its conceivable (to me!) that size() could be O(1). For my application, the lists can be quite long (millions of elements), so the answer greatly...
3
1779
by: Bruno G. | last post by:
Hello! Is it possible for IIS to send some sort of notification when an ASP error occurs on a page? I can see them in the web logs, but I was wondering if there was a way to receive an email or some other alert... I thought about using CDO Send Mail, but this object is often what cause the error in the first place.
2
2558
by: Kelly | last post by:
I have a subform that display requisition information. One of the fields in the subform is a combo box that shows who requested the requisition. The users can change who requested the requisition and I would like to only have them be able to choose active employees. So, I have written the query for the rowsource for this combo box, which is based on an employees table, to look at all active employees and the employee that is currently...
6
1843
by: Shaun Wilde | last post by:
I am trying to handle a 404 errors and redirect them to the correct page based on criteria I was hoping to catch the error in the global error handler and forward via Server.Transfer to the correct page such that it would appear to be the page requested. ow this does work to a fashion but it seems that I don't have access to the session state when I undergo a Server.Transfer from the Application_Error. Can anyone suggest another way...
35
3641
by: Thierry Loiseau | last post by:
Hello all, and Happy end year 2005 ! Well, I would like to obtain a list of all JavaScript var statement, With "for...in" perharps ? That is bellow my recent test here, but the problem is to management theses :-((( I must to declare and use all variable with this scheme :
3
1438
by: Kevin | last post by:
Allen, I tried creating one of the report list boxes you have on your page (http://allenbrowne.com/ser-19.html). I created the chk box, cmd button, and module (saved as EnumReports). I assigned the listbox a RowSourceType of EnumReports, and left RowSource blank. When the form loads, I either get a "too much memory requested", which I fix temporarily by changing the sRptName size down a little, or I get nothing in my report list.
5
1287
by: DrKen | last post by:
I asked last week about passing a popup selection back to the main window. Now comes another challenge. The drop down list (or other organization?) has over 36000 entries (it's a list of colleges one might have attended). I don't think I want to hard code 36000 entries or if I do, I don't want users to have to scroll through 35000 to get down to Washington, for example. What would it take to make a "smart" drown down or scrollable list...
4
2442
by: dineshv | last post by:
I want to see if there is an alternative method for fast list traversal. The code is very simple: dict_long_lists = defaultdict(list) for long_list in dict_long_lists.itervalues() for element in long_list: array_a = m + n + p # m,n,p are variable numbers The long_list's are read from a defaultdict(list) dictionary and so
0
9876
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9717
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10683
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10320
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9459
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5699
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4506
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4096
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3148
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.