Computer Science, asked by debarpanchaudhuri, 2 months ago

write a Java program​

Attachments:

Answers

Answered by Anonymous
90

\large \green { \fcolorbox{purple}{WHITE}{ \: \textsf{\ \ \ \ddag \ \ \ \ \ \pink{Answer :-}\ \ \ \ \ \ddag \ \ \ }}}

import java. util.*;

class number

{

public static void main(String args[] )

{

Scanner sc= new Scanner (System. in);

System. out. print("Enter a number: ");

int n= sc. nextint();

if (n%3==0&&n%5==0)

System. out. printIn("Number is divisible by 3 and 5.")

else if (n%3==0&&n%5!==0)

System. out. printIn("Number is divisible by 3 and 5.")

else if (n%3==0&&n%5!==0)

System. out. printIn("Number is divisible by 3 and 5.")

else if (n%3==0&&n%5!==0)

Answered by ᎪzríeƖ
14

Required Program :

import.java.util.*;

public class number

{

public static void main (String args[])

{

Scanner in = new Scanner(System.in);

int a,b,c,avg;

System.out.println("Enter a number");

a = in.nextInt();

b = a/10;

c = a%10;

avg = (b+c)/2;

System.out.println("Average of the digits ="+avg);

}

}

_______________________ \:

Similar questions