Javascript programme
Answers
1
import java.util.*;
public class p1
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
System.out.println("enter two numbers”);
int a = in.nextInt();
int b = in.nextInt();
if (a = = b)
System.out.println("the Numbers are equal");
}
}
2
import java.util.*;
public class p2
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
System.out.println("enter a numbers”);
int a = in.nextInt();
System.out.println("square = "+(a*a));
}
}
3
import java.util.*;
public class p1
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
System.out.println("enter a number”);
int a = in.nextInt();
if ( a%3==0)
System.out.println("the number is a multiple of 3");
if ( a%7==0)
System.out.println("the number is a multiple of 7");
}
}