Write a program to initialize an
int variable a with 76498 and from it extract the
first digit and store it in f and extract the last
digit in l and display both these digits.
Class 9 - Computer Applications - Ch 3
Answers
Answered by
39
Hey there!
Answer:
public class Question
{ 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);
} }
Hope It helps You!
Answered by
17
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
Chemistry,
6 months ago
Chemistry,
6 months ago
Math,
1 year ago
Social Sciences,
1 year ago
History,
1 year ago