Sign up for Free !!
World's first open source developer community with
Ticketing System
--> operator in c++?
It is not a single operator. In fact it is two separate operators -- and >.
"--" Operator is decreases the value of a variable by 1
#include <iostream> using namespace std;
int main() { int x = 5; --x; cout << x; return 0; }
">" operator is greater than
int main() { int x = 3; int y = 1; cout << (x > y); // returns 1 (true) because 3 is greater than 1 return 0; }
Please Login/Register to write your answer !!!
It is not a single operator. In fact it is two separate operators -- and >.
"--" Operator is decreases the value of a variable by 1
#include <iostream>
using namespace std;
int main() {
int x = 5;
--x;
cout << x;
return 0;
}
">" operator is greater than
int main() {
int x = 3;
int y = 1;
cout << (x > y); // returns 1 (true) because 3 is greater than 1
return 0;
}