why am i getting this error

i keep getting the error saying that the system cannot find the specified file, what does that mean.
the assignment is to write a program that converts yards and feet to inches and sum them up so the final output should be total number of inches. This is what i have so far someone tell me what i am doing wrong and or missing please.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
  #include <iostream>
using namespace std;

main()
{
	int inches; 
	int feet;
	int yards;

	inches = 12
	feet = inches/12 
	yard = inches/36

	cout << "Enter number of inches\n";
	cin >> inches
	cout << "enter number of yards\n";
	cin >> yards
	cout << "enter number of feet\n;


	 
main must return int
Lines end with semi-colons (10, 11, 12, 15, 17);
Also lines 10-12 you are doing integer division. Make the left, right, or both sides a floating point (float or double). You can do this by casting or adding a '.' or '.0' to the end of the values or changing the type from int to float/double.
im still getting that error
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 #include <iostream>
using namespace std;

int main() // main usually returns int
{
	int inches; 
	int feet;
	int yards;

	inches = 12 /// missing ; you don't need to set this to a value since you are having a user input the value
	feet = inches/12 // missing ; you are changing this value later in with cin>>
	yard = inches/36 // missing ; you are changing this value later in with cin>>
    
	cout << "Enter number of inches\n";
	cin >> inches
	cout << "enter number of yards\n";
	cin >> yards
	cout << "enter number of feet\n"; ///missing end quote
//convert your yards, feet,stuff down here so you don't over write the values..
       return 0;  // always return 0 to specify that there were no errors
} // close your main function 

Last edited on
The error sounds like you are using visual studio or code::blocks and created a cpp file and tried to build that instead of building a project.
mrah check out my code, try running that...tell me what happens
Yours doesn't compile either nvolleof. Look at my first post and you will figure out why.
yea it didnt work either i keep getting that error and its driving me crazy
figure it out, it was because i identified the integer as "yards" but used it as yard in the code so the whole code wasnt running because of it
Good job mrahim! ....Totally missed that line 12...Nice catch!
Last edited on
Topic archived. No new replies allowed.