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:
![](https://hi-static.z-dn.net/files/d7f/4fd70814cd8a5fed468285f2747aff2a.jpg)
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:
![](https://hi-static.z-dn.net/files/d25/334222ed16f735213555f0ab0a6f1f8b.jpg)
Similar questions