1)
#include <iostream>
int main() {
int x=5;
std::cout << "In ++X, first increment then print="<<++x;
std::cout << "So it is called pre increment.\n \n";
std::cout << "In X++, first print then incrment"<<x++;
std::cout << "So it is called post increment";
return 0;
}
2) #include <iostream>
int main() {
int a,b,x,y;
a=4;
x=2;
y=3;
x = a++ +(b+=x+y);
std::cout << "The result of the above terms will be="<<x;
return 0;
}
Comments
Leave a comment