Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

Hello may you please solve my error?

+16 votes
asked Oct 12, 2022 by Alexandra Reign Ramos (220 points)
Error
main.cpp:15:3 error: expected initializer before 'cout'

15 | cout<< "Input any amount of money "
      | ^~~~

7 Answers

+4 votes
answered Oct 12, 2022 by Peter Minarik (86,200 points)
First of all, you'll probably need a semicolon (;) at the end of line 15.

The problem would be probably in one of the previous lines (missing semicolon perhaps?). We'll need to see the full code to see what the problem really is.
+1 vote
answered Oct 17, 2022 by Eidnoxon (5,140 points)
edited Oct 17, 2022 by Eidnoxon
I'm not a c++ expert, but i used to learn it. First of all, you forgot the semicolon (;) sign at the end. And i think you forgot to enter the code "using namespace std;"  in your c++ file? It's just a tipp.
0 votes
answered Oct 17, 2022 by Sarang Pawar (180 points)
Forgotten Semicolon(;) and using namespace std; after header file.
0 votes
answered Oct 18, 2022 by Rajneesh Kabdwal (140 points)
Please upload the full code
0 votes
answered Oct 19, 2022 by princeverma20 (140 points)

you have to relpace  THis

cout<< "Input any amount of money "  to cout<< "Input any amount of money ";

0 votes
answered Oct 19, 2022 by sakshi singh (140 points)
please give your full code with question
0 votes
answered Oct 22, 2022 by Ligma (160 points)
Hi

If you want to solve this problem be sure the you used "using namespace std;" , than you should put the ";" at the finish of that line and check if there is there is a semicoln at the finish of the line before this one.

Hope you find a solution!
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...