specify a class demo to initialise two integer M and n with the value 12 and 9. interchange the value of M and n print the value of M and n before and after interchange?
Answers
Answered by
16
class demo
{
public static void main(String args [])
{
int M=12, n=9, d;
sopln("M="+M);
sopln("n="+n);
d=n;
n=M;
M=d;
sopln("M"+M);
sopln("n="+n);
}}
{
public static void main(String args [])
{
int M=12, n=9, d;
sopln("M="+M);
sopln("n="+n);
d=n;
n=M;
M=d;
sopln("M"+M);
sopln("n="+n);
}}
Similar questions
English,
7 months ago
Science,
7 months ago
Social Sciences,
7 months ago
Chemistry,
1 year ago
Math,
1 year ago
Math,
1 year ago
Science,
1 year ago
Social Sciences,
1 year ago