Print The Following Pattern Using 1) For 2) While Using While Loop: Public Class Public Static Void Int Int While
Print The Following Pattern Using 1) For 2) While Using While Loop: Public Class Public Static Void Int Int While
{
System.out.print(i);j++;
}
i++;
System.out.println();
}
}
for(int j=1;j<=i;j++)
{
System.out.print(i);
}
System.out.println();
}
}
}
import java.io.*;
abstract class Math
{
static int a=5;
double b=2.5;
abstract void add();
void multiply()
{
System.out.print("the multiplication value is ");
System.out.println(a*b);
}
void division()
{
System.out.print("the division answer is ");
System.out.println(a/b);
}
}
public class work extends Math
{
int x=10;
void add()
{
System.out.print("the added value is ");
System.out.println(x+a);
}
void multiply()
{
System.out.print("the multiplication value is ");
System.out.println(x*a);
}
void division()
{
System.out.print("the division answer is ");
System.out.println(x/a);
}
public static void main(String[] args)
{
work a=new work();
work b=new work();
work c=new work();
a.add();
b.multiply();
c.division();
}
}