0

int x = 12 ; int y= ++x ; cout << x ; . In this what is the output

Please answer

20th Jun 2018, 4:29 PM
Superman Batman
Superman Batman - avatar
10 Answers
+ 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/
20th Jun 2018, 4:30 PM
į Œį ŒCode X
į Œį ŒCode X - avatar
+ 1
y will be 13
20th Jun 2018, 4:33 PM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar
0
and
20th Jun 2018, 4:31 PM
Superman Batman
Superman Batman - avatar
0
y
20th Jun 2018, 4:31 PM
Superman Batman
Superman Batman - avatar
0
y will also be 6?
20th Jun 2018, 4:32 PM
Superman Batman
Superman Batman - avatar
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.
20th Jun 2018, 4:38 PM
$Ā¢šŽā‚¹š”­!šØš“
$Ā¢šŽā‚¹š”­!šØš“ - avatar
0
thank you
21st Jun 2018, 2:14 AM
Superman Batman
Superman Batman - avatar
0
13
22nd Jun 2018, 1:26 PM
huyu
0
y=++x ++x=13 so y=13 and x increases itself so x=13
29th Jun 2018, 4:16 PM
vivek patel
vivek patel - avatar
0
y=++x ++x=13 so y=13 and x increases itself so x=13
29th Jun 2018, 4:17 PM
vivek patel
vivek patel - avatar