Computer Science, asked by sparklycupcake, 1 day ago

Please do a variable description table for the following program:

import java.util.*;
class Sum_Digits
{
public static void main(String args[])
{
Scanner in= new Scanner(System.in);
int i,d,n,p,c=0,s=0;
System.out.println("Enter a number: ");
n=in.nextInt();
p=n;
for(i=n;n>0;n=n/10)
{
d=n%10;
c=c+1;
}
System.out.println("Number of digits are: "+c);
for(i=p;p>0;p=p/10)
{
d=p%10;
s=s+(int)Math.pow(d,c);
}
System.out.println("The result= "+s);
}
}

Answers

Answered by krishmodi35
0

Answer:

hope it helps you ☺️☺️

Attachments:
Similar questions