what is wrong in this program of java (written in bluej) :
import java.util.Scanner;
public class v
{
public static void main()
{
int k=0,n=1;
int sum=0;
Scanner s=new Scanner(System.in);
System.out.println("enter number");
String m=s.next();
int a=m.length();
System.out.println(a);
k=a-1;
for(n=1;n<=a;n=n+1)
{
k=a-n;
char z=m.charAt(k);
sum=sum+z;
}
System.out.println("total sum"+sum);
}
}
(in the answer 48 gets automatically added)
please answer if you know
THANKS
nitish8089:
What are you giving input.
Answers
Answered by
0
Answer:
Aur thoda bada question puch lo
Similar questions