Guess the output of this expression.i=1; | Sololearn: Learn to code for FREE!

+13

Guess the output of this expression.i=1;

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

5/28/2017 6:48:35 AM

Prabhu Nithin

21 Answers

New Answer

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;

+12

Is it because of long long type over-flow ?

+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.

+11

Wrong answer

+11

+11

😱😱😱😨😨

+11

can you explain it ?

+11

+10

+10

anytime !! πŸ˜ƒ

+10

yes please

+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;

+2

@Setiawan Well, your code is full of wisdom. I like it so much. Please explain to me..

+2

@prabhu yes, it is. that cause undefined behaviour. the output is depent on compiler.

+2

This is what @Calvin told me : "You have reached the edge of the Universe." πŸ˜ƒπŸ˜ƒπŸ˜ƒ

+1

you right, thank for the lesson.

+1

use codeplayground

+1

well, calvin explained to me. i can explained to you if you want.

+1

Lol @Setiawan, you still remember..πŸ˜‚

0