How to use sort if in cout with C++

2 Answers

0 votes
#include <iostream>

int main() {
    int n = 7;
    
    std::cout << (n > 5 ? "abc" : "xyz");
}




/*
run:

abc

*/

 



answered Feb 21, 2022 by avibootz
0 votes
#include <iostream>

int main() {
    for (int i = 0; i < 10; i++)
		std::cout << (i ? ", " : "") << i;
}



/*
run:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

*/

 



answered Oct 16, 2022 by avibootz

Related questions

1 answer 212 views
1 answer 167 views
2 answers 242 views
1 answer 181 views
1 answer 212 views
1 answer 315 views
1 answer 140 views
140 views asked Apr 10, 2018 by avibootz
...