Predict the output for the following:- (Based on Java)
1) If m=5 and n=2, predict the output values of m and n:
a) m - =n; b) n= m + m/n;
2) What will be the output from the program segment?
int a=0, b=10, c=40;
a= - - b +c ++ +b;
System.out.println( " a = " + a);
Answers
Explanation:
1.for making the text look coloured refer the below syntax and ignore the dots
[.tex]\red{the\:text\:appears\:in\:red}[./tex]
result
\red{the\:text\:appears\:in\:red}thetextappearsinred
2.for making the text marquee
[.tex]<marquee>{the\:text\:appears\:like\:this}</marquee>[./tex]
result
= < marquee > {the\:text\:appears\:like\:this} < /marquee > <marquee>thetextappearslikethis</marquee>
3. for making the text look bold
[.tex]\bold{the\:text\: appears\: like\: this }[./tex]
result =
\bold{the\:text\: appears\: like\: this }thetextappearslikethis
4. for showing the exponential value
[.tex]{no.}^{power}[./tex]
result
= {no.}^{power}[ /tex] 5. for showing the square root value [.tex]\sqrt{no.}[./tex] result = 5.forshowingthesquarerootvalue[.tex]
no.
[./tex]result=[tex]
no.
\bold{\boxed{thanx}}
thanx
follow me next