Skip to content

Write a program to input an integer, find the result of the multiplication of that number by the numbers 1 - 20 , then print the result to the screen.

Notifications You must be signed in to change notification settings

hollandemmitt/Write-a-program-to-input-an-integer-find-the-result-of-the-multiplication-of-that-number-by-the-num

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

Write-a-program-to-input-an-integer-find-the-result-of-the-multiplication-of-that-number-by-the-num

Write a program to input an integer, find the result of the multiplication of that number by the numbers 1 - 20 , then print the result to the screen. import java.util.Scanner;

public class BaiTapJavaCoBan7 { public static void main(String[] args) { int n; int sum = 0; System.out.println("Nhập vào số nguyên:"); Scanner sc = new Scanner(System.in);

  n = sc.nextInt();

  for (int i = 1; i <= 20; i++) // duyệt tất cả phần tử từ 1-20
  {
     System.out.println(n + " x " + i + " = " + n*i);
  }

} }

About

Write a program to input an integer, find the result of the multiplication of that number by the numbers 1 - 20 , then print the result to the screen.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published