0

What to do to print only one line?

<<"C++ is bad "; <<"C++ is good"; I want only "C++ is good" in output

5th Oct 2021, 12:57 PM
Akhilesh Choudhary
Akhilesh Choudhary - avatar
6 Antworten
+ 1
Comment out the above line //cout<<"c++ is bad"; cout<<"c++ is good"; Or /*cout<<"c++ is bad";*/ cout<<"c++ is good"; ..And if you are asking about how to next statement in new line then you can use endl, cout<<"c++ is bad"<<endl; cout<<"c++ is good"<<endl;
5th Oct 2021, 1:21 PM
Rupali Haldiya
Rupali Haldiya - avatar
+ 2
Your question is not clear what do you mean by print one line.
5th Oct 2021, 1:03 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Delete the line that prints out C++ is bad, or comment it out.
5th Oct 2021, 1:18 PM
Chloe
Chloe - avatar
+ 1
if there is no need of first statement then why u want to print it just make it comment . If u dont want to do comment then youn write both statement in if else condition or use switch case if your condition will be true then first statement will execute otherwise second one.
5th Oct 2021, 1:19 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Or you can do like this #include <iostream> using namespace std; int main() { cout<<11+"C++ is bad ""C++ is good"; return 0; }
5th Oct 2021, 1:21 PM
A S Raghuvanshi
A S Raghuvanshi - avatar
0
#include <iostream> int main() { std.count << "Only one line"; return 0; }
6th Oct 2021, 6:18 PM
🌀 Shail Murtaza شعیل مرتضیٰ
🌀 Shail Murtaza شعیل مرتضیٰ - avatar