+ 2

I've coded a program, but when i run, it says that it has a compilation error. What may be the reason??

#include <iostream> using namespace std; int main() { float Length, Breadth, arearec; cout<<"\n Enter Length"; cin>> Length; cout<<"\n Enter Breadth"; cin>> Breadth; arearec= Length*Breadth; cout<<"\n area of rec

18th Feb 2017, 2:08 PM
Gowtham Amarnath
Gowtham Amarnath - avatar
10 Réponses
+ 2
first cout is missing closing quotation marks.
18th Feb 2017, 2:22 PM
Milan Todorovic
Milan Todorovic - avatar
+ 1
#include <iostream> using namespace std; int main() { float Length, Breadth, arearec; cout<<"/n Enter Length"; cin>> Length; cout<<"/n Enter Breadth"; cin>> Breadth; arearec= Length*Breadth; cout<<"/n area of rectangle"<<arearec; }
18th Feb 2017, 2:24 PM
Gowtham Amarnath
Gowtham Amarnath - avatar
+ 1
You have forgotten to close the first quotation mark
18th Feb 2017, 2:25 PM
Orfeo Terkuci
Orfeo Terkuci - avatar
+ 1
I don't think /n exists. You probably meant \n for new line.
18th Feb 2017, 2:28 PM
Milan Todorovic
Milan Todorovic - avatar
+ 1
What does the error say?
18th Feb 2017, 2:35 PM
Milan Todorovic
Milan Todorovic - avatar
+ 1
I have no idea what it could be. Try changing float to double. Maybe it can't fit the decimal places into float.
18th Feb 2017, 2:48 PM
Milan Todorovic
Milan Todorovic - avatar
0
thanks for replying my friend. what abt the edited code which is up. its not giving an answer
18th Feb 2017, 2:25 PM
Gowtham Amarnath
Gowtham Amarnath - avatar
0
Well, I changed it from /n to \n, but its not working
18th Feb 2017, 2:34 PM
Gowtham Amarnath
Gowtham Amarnath - avatar
0
#include <iostream> using namespace std; int main() { float Length, Breadth, arearec; cout<<"\n Enter Length"; cin>> Length; cout<<"\n Enter Breadth"; cin>> Breadth; arearec= Length*Breadth; cout<<"\n area of rectangle"<<arearec; } Its giving a non-related output
18th Feb 2017, 2:39 PM
Gowtham Amarnath
Gowtham Amarnath - avatar
0
Sorry, my friend MILAN. Even if I change into double, its not working.
18th Feb 2017, 2:50 PM
Gowtham Amarnath
Gowtham Amarnath - avatar