Bài tập vòng lặp java

2 46 0
Bài tập vòng lặp java

Đang tải... (xem toàn văn)

Thông tin tài liệu

Bài Tập thi thử Java về chủ đề Vòng lặp với bộ 7 câu hỏi với giá 7,000 VNĐ do mình tự biên soạn, với 4 bài cơ bản và 3 bài nâng cao, dành cho sinh viên ngành CNTT hoặc các bạn học sinh muốn tìm tại liều bài tập để luyện tập Java

Bài Tập Vòng Lặp JAVA Write a program that has one parameter that specifies an integer n and prints n copies of 1, followed on the next line by n-1 copies of 2, followed on the next line by n-2 copies of 3, … with the last line printing one n You may assume n is positive As an example, printN(6) would result in the following output: 111111 22222 3333 444 55 Write an algorithm to accept a number between and and display a pattern For example, if the number entered is 5, the following pattern should be displayed: 21 321 4321 54321 Write a program to read an integer number (n>0) Write flowing methods: - Checking whether the input number is a prime number or n - Print out prime submultiples of number n - Generate the first 100 prime numbers Write a program to read an integer number (n>0) Write following methods: - Checking whether a number is a perfect number or not? - Generate the first n perfect numbers Write a program that computes: P = 1!+ 2!+ 3!+…+ n! S1= 12 + 22 +…+ n2 Write a method to read a number (N>0) from keyboard and compute sum of number’s numerals Example: Suppose N = 25364, N include numerals: 2, 5, 3, 6, The sum of number’s numerals Write a program to find Highest Common Factor (HCF) and Least Common Multiple of two integer numbers

Ngày đăng: 31/08/2023, 16:37

Tài liệu cùng người dùng

Tài liệu liên quan