| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need help
Could someone tell me why my program isnt compiling correctly. I get the ___.exe has encountered a problem and needs to close. We are sorry for the inconvenience. *ERROR*. Here is my code someone please help me.
#include <iostream.h> #include <fstream.h> main () { int total=0, c, frogbats[100], truck[100], i, first, second, last, remain; ifstream get_data ("c:/temp/orders.txt"); for (c=0; c<=6; c++) { get_data>>frogbats[c]; cout<<frogbats[c]<<endl; if (total + frogbats[c]<40) { truck[i]=total + frogbats[c]; } else; if (frogbats[c]>40) { if (frogbats[c]<80) { i++; first= frogbats[c]/2; second= frogbats[c]/2; remain= frogbats[c]%2; last= remain + second; i++; } else (frogbats[c]>80); { i++; first= frogbats[c]/3; second= frogbats[c]/3; last= frogbats[c]/3; remain= frogbats[c]%3; } if (remain>1) { second++; last++; i++; } else; { last++; i++; } } } cout<<total; return (0); } |
|
#2
|
|||
|
|||
|
this program is supposed display the number of frogbats in each truck with a limit of forty
|
|
#3
|
|||
|
|||
|
Code:
main () Should it have a void or a int? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > C/C++ Help > I need help |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|