+ 2
why I am getting different results in different environments or different languages for below program
when i write in c & run in dos,i get output as 66 when i write in java & run in command prompt,i get output as 76 import java.util.*; import java.lang.*; class increment { public static void main(String args[]) { int x=10,res; res=x++ + ++x + x++ + x++ + x++ + x++; System.out.print("result:"+res); } }
2 Antworten
+ 1
The answer should come as 76,i checked it
+ 1
@kevin vaz but in c it's getting 66 plz run in dos prompt