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
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
Math,
2 months ago
English,
2 months ago
Computer Science,
2 months ago
English,
4 months ago
Math,
10 months ago