Computer Science, asked by souravrajak2020, 2 months ago

write a program in Java assume 4 digit number and find its first and last digit and also display first and last digit

Please don't spam he forum or I will report that user ​

Answers

Answered by kamalrajatjoshi94
0

Answer:

Program:-

import java.util.*;

public class Digit

{

public static void main(String args[ ])

{

Scanner in=new Scanner(System.in);

int n,ld=0,fd=0,num=0;

System.out.println("Enter the 4 digit number");

n=in.nextInt();

num=n;

ld=n%10;

while(num!=0)

{

fd=num%10;

num=num/10;

}

System.out.println("First digit="+fd);

System.out.println("Last digit="+ld);

}

}

Answered by Anonymous
0

Answer:

s..e..x..

comme the answer

only gi.rl.s

id- 509 417 6945

p- aaz

on z..oo..m

Explanation:

s..e..x..

comme the answer

only gi.rl.s

id- 509 417 6945

p- aaz

on z..oo..m

Similar questions