without return type and no parameter write a program in java to print tables of 3.
Answers
Answered by
3
The given code is written in Java.
public class MultiplicationTableOfThree{
public static void main(){
System.out.println("Multiplication Table of 3 - \n");
for(int i=1;i<=10;i++)
System.out.println("3 * "+i+" = "+3*i);
}
}
- Repeat from i = 1 to 10.
- Display the value of 3i
See the attachment for output.
Attachments:
Answered by
3
Answer:
Program:-
import java.util.*;
public class Main
{
public static void main(String args[])
{
Scanner in=new Scanner(System.in);
int n,i;
System.out.println("Enter the limit of table of 3:");
n=in.nextInt();
System.out.println("The table of 3 upto "+n+":");
for(i=1;i<=n;i++)
{
System.out.println("3×"+i+"="+(3*i));
}
in.close();
}
}
Attachments:
Similar questions