0
int x = 12 ; int y= ++x ; cout << x ; . In this what is the output
Please answer
10 Respuestas
+ 4
x is 13 due to the ++x.
it increments x by 1.
btw you can use the code playground..
heres a lesson..
https://www.sololearn.com/learn/CPlusPlus/1610/
+ 1
y will be 13
0
and
0
y
0
y will also be 6?
0
#include <iostream>
using namespace std;
int main() {
int x= 12;
int y = x += 1;. //equivalent to y = ++x
cout<<x<<y<<endl;
return 0;
}
y will be 13.
try above code for better understanding.
0
thank you
0
13
0
y=++x
++x=13
so y=13
and x increases itself so x=13
0
y=++x
++x=13
so y=13
and x increases itself so x=13