Computer science
Can anyone send me the answers of these sums 12 part.
Attachments:
wielenthemant:
hiii
Answers
Answered by
1
pre-increment(++) or pre-decrement(--)[before identifier]::we had to increment the variable value by one(++) or decrement by value one(--) and then evaluate that expression....
example:
a=12;
b=++a;
System.out.println(b);
output:13
post-increment( after identifier ++)or post-decrement( after identifier --):::we had to evaluate expersion first then increment the variable value by one(++) or decrement value by one(--).
a=12;
b=a++;
System.out.println(b);
output:12
note: increme
using this rule.....
output.....
1) a=12+11+12=35
2)b=13+13*2=13+26=39
3)c=11+12*(14)=11+168=179
4)b=13+15+11+13=52
5)a=179
example:
a=12;
b=++a;
System.out.println(b);
output:13
post-increment( after identifier ++)or post-decrement( after identifier --):::we had to evaluate expersion first then increment the variable value by one(++) or decrement value by one(--).
a=12;
b=a++;
System.out.println(b);
output:12
note: increme
using this rule.....
output.....
1) a=12+11+12=35
2)b=13+13*2=13+26=39
3)c=11+12*(14)=11+168=179
4)b=13+15+11+13=52
5)a=179
Similar questions