State the output of the following function :
public void show()
long y = 838383, n = y, p, s;
while( n>0)
p= n % 10;
System.out.println( Math.pow(p, 2));
n= n/100;
System.out.println( y );
Attachments:
Answers
Answered by
1
Answer:
9
838383
Explanation:
The value of p is 3 as the rightmost digit of n is 3. The square of 3 is 9 and thus is printed in a line. Now, the value of n is divided by 100. This makes the value of n as 8383. Now, y is printed.
Similar questions
Math,
5 months ago
Business Studies,
5 months ago
Physics,
5 months ago
Math,
11 months ago
Math,
11 months ago
Social Sciences,
1 year ago
Science,
1 year ago