+ 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; } }
2 Respostas
+ 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
+ 1
Thank you I got it to work