write down a java program to input a a number and check and print whether it is a pronic number or not. Use a function int Pronic(int n) to accept a number. The function returns 1,if the number is 'Pronic',otherwise returns zero(0).
Answers
Answer:
Explanation:
Java programming code
import java.util.Scanner;
class AddNumbers
{
public static void main(String args[])
{
int x, y, z;
System.out.println("Enter two integers to calculate their sum");
Scanner in = new Scanner(System.in);
x = in.nextInt();
y = in.nextInt();
z = x + y;
System.out.println("Sum of the integers = " + z);
}
}
Explanation:
import java. until. Scanner;
public class check
{
public static void main()
int n, b;
Scanner Sc=new Scanner(System.in);
System. out. println(enter n and b);
n=Sc.nextInt();
b=(int)math.sqrt(n);
int x=b*(b+1);
if(x==n)
System. out.println(n+"is a pronic no. ");
else
System. out. println(n+"is not a pronic no. ")
}
}
pls mark as the brainliest ans.... pls