QuestionCODE

Posts 1–7 of 7 · Page 1 of 1
CODE
Whats wrong with my code?

Code:
/*
   Credits:
   --Pxpc2 C++ book
   */

#include <iostream>
using namespace std;

int main ()
{
	int length; // this should declare a variable.
	int width; // this should declare another variable.

	cout << "Enter the Length: ";
	cin >> length; // ....................................................../////////

	cout << "enter the width: ";
	cin >>; // lalalalalalala

	cout << "The area is ";
	cout << length * width; // ...

	return 0
}
Used to let the user to insert the rectangle dimensions
So ; I heard you Liek Semicolons and Get's ?
cin >>; // lalalalalalala

to

cin >> width; // lalalalalalala
Quote Originally Posted by Gab View Post
cin >>; // lalalalalalala

to

cin >> width; // lalalalalalala
If you are to spoonfeed him at least tell him he needs the semicolon after the return Value.
Look over your code. You're trying to get user input and put the entered value into a semi-colon (which is not possible). Also you forgot a semi-colon after return 0 which will cause the code to 'unexpectedly' end.
Oh thanks alot

/Req close
~ Closed on request ~
Posts 1–7 of 7 · Page 1 of 1
This thread is closed for replies.

Tags for this Thread

None

Talk with us