Write a simple program that accepts two number A and B. Assign A to B in two scenarios 1) assign A to B by pre-incrementing A and observe the output 2)assign A to B by post-incrementing A and observe the output 3) swap both values
Answers
Answered by
0
Answer:
// CPP program to demonstrate pre increment
// operator.
#include <iostream>
using namespace std;
int main()
{
int x = 10, a;
a = ++x;
cout << "Pre Increment Operation";
// Value of a will change
cout << "\na = " << a;
// Value of x change before execution of a=++x;
cout << "\nx = " << x;
Similar questions