Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to use decrement operator in c++

#include <iostream>
using namespace std;

int main()
{
  int x = 5, y = 5;
  
  cout << x-- << " " << --y ;
  // Outputs 5 4
  
  return 0;
}
 
PREVIOUS NEXT
Tagged: #decrement #operator
ADD COMMENT
Topic
Name
9+9 =