English, asked by Rainbowgain, 2 months ago

Write a program to input a number and check whether it's divisible by 7 or not if it's then find square else find cube​

Answers

Answered by Anisha5119
7

Answer:

import java.io.*;

class Div7

{

public static void main()

{

if(s%7==0)

{

System.out.println(s+" is divisible by 7 and square of="+s+"is"+(s*s));

}

else

{

System.out.println(s+" is not divisible by 7 and cube of="+s+"is"+(s*s*s));

}

}

}

Similar questions