What is the output of the program: while loop and tenary operator - C++ Statement

C++ examples for Statement:while

Description

What is the output of the program: while loop and tenary operator

Demo Code

#include <iostream>
using namespace std;

int main() {//from   w  w w  . j a v a  2  s  .co m
   unsigned int count{1};

   while (count <= 10) {
      cout << (count % 2 == 1 ? "****" : "++++++++") << endl;
      ++count;
   } 
}

Result


Related Tutorials