what am i doing wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what am i doing wrong

#include <iostream> using namespace std; int main() { int overhead = 1000000; int price = 3000000; int cost = 2000000; int sold; int income; int made = 10; int expenses = (cost*made) + overhead; cout << "how many units did you sell"; endl; cin >> sold; income = sold*price; int profit = income-expenses; if (profit < 0) { cout << "loss" << endl; } else if (profit == 0){ cout << "broke even" << endl; } else { cout << "profit" << endl; } }

5th Apr 2020, 6:09 AM
Joshua Flynn
Joshua Flynn - avatar
2 Answers
+ 2
On line 12, you have written "endl" seperately. as "endl" is a manipulator not a standalone function so it should be accompanied with "cout" Here is the fix👇 https://code.sololearn.com/caef0tKgdGrU/?ref=app
5th Apr 2020, 6:22 AM
Arsenic
Arsenic - avatar
+ 1
Thank you I got it to work
5th Apr 2020, 6:11 PM
Joshua Flynn
Joshua Flynn - avatar