write a program to initialize an int variable a with 76498, and from it extract the first digit and score it into a variable f and extract the last digit into a variable e , and display both these digits .
please solve this, I want it urgently..
Answers
Answered by
40
Here is your answer........
Attachments:
Answered by
2
Program:
public class Question9
{
static void main()
{
int a=76498,f,l;
f=a/10000;
l=a%10;
System.out.println("First digit="+f);
System.out.println("Last digit="+l);
}
}
Similar questions