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.
Login
Login
OnlineGDB Q&A
Questions
Unanswered
Tags
Ask a Question
Ask a Question
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 "
| ^~~~
Your answer
Your name to display (optional):
Email me at this address if my answer is selected or commented on:
Email me if my answer is selected or commented on
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
7 Answers
+4
votes
answered
Oct 12, 2022
by
Peter Minarik
(
86,900
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.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
+1
vote
answered
Oct 17, 2022
by
Eidnoxon
(
5,160
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.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Oct 17, 2022
by
Sarang Pawar
(
180
points)
Forgotten Semicolon(;) and using namespace std; after header file.
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Oct 18, 2022
by
Rajneesh Kabdwal
(
140
points)
Please upload the full code
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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 ";
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
0
votes
answered
Oct 19, 2022
by
sakshi singh
(
140
points)
please give your full code with question
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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!
Your comment on this answer:
Your name to display (optional):
Email me at this address if a comment is added after mine:
Email me if a comment is added after mine
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please
log in
or register.
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.
...