+ 13

Guess the output of this expression.i=1;

cout<<++i<<i++;

28th May 2017, 6:48 AM
Prabhu Nithin
Prabhu Nithin - avatar
21 Antworten
0
right, how about this? unsigned long long x=12345678912345678912; unsigned long long y=123456789123456789123; unsigned long long z=1234567891234567891234; cout<<x<<endl; cout<<y<<endl; cout<<z<<endl;
28th May 2017, 7:10 AM
Setiawan Next
Setiawan Next - avatar
+ 12
Is it because of long long type over-flow ?
28th May 2017, 7:26 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 12
The range of unsigned long long int is 0 to 18,446,744,073,709,551,615. If it exceeds limit value , it will be truncated.
28th May 2017, 7:28 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
Wrong answer
28th May 2017, 6:55 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
1043
28th May 2017, 7:08 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
😱😱😱😨😨
28th May 2017, 7:10 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
can you explain it ?
28th May 2017, 7:15 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 11
How ?
9th Jul 2017, 11:39 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 10
it's 31
28th May 2017, 6:56 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 10
anytime !! 😃
28th May 2017, 7:07 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 10
yes please
28th May 2017, 7:22 AM
Prabhu Nithin
Prabhu Nithin - avatar
+ 2
now how about this? what is the output ? no codeplayground, please. char a[]=""; char b[]="C++"; cout <<sizeof(a)<<endl; cout <<strlen(a)<<endl; cout <<sizeof(b)<<endl; cout <<strlen(b)<<endl;
28th May 2017, 7:07 AM
Setiawan Next
Setiawan Next - avatar
+ 2
@Setiawan Well, your code is full of wisdom. I like it so much. Please explain to me..
28th May 2017, 7:23 AM
Calviղ
Calviղ - avatar
+ 2
@prabhu yes, it is. that cause undefined behaviour. the output is depent on compiler.
28th May 2017, 7:29 AM
Setiawan Next
Setiawan Next - avatar
+ 2
This is what @Calvin told me : "You have reached the edge of the Universe." 😃😃😃
28th May 2017, 7:31 AM
Setiawan Next
Setiawan Next - avatar
+ 1
you right, thank for the lesson.
28th May 2017, 7:05 AM
Setiawan Next
Setiawan Next - avatar
+ 1
use codeplayground
28th May 2017, 7:12 AM
Setiawan Next
Setiawan Next - avatar
+ 1
well, calvin explained to me. i can explained to you if you want.
28th May 2017, 7:19 AM
Setiawan Next
Setiawan Next - avatar
+ 1
Lol @Setiawan, you still remember..😂
28th May 2017, 7:36 AM
Calviղ
Calviղ - avatar
0
22
28th May 2017, 6:54 AM
Setiawan Next
Setiawan Next - avatar