Please find the code below:
PrintPairOfThirty.java
package classes13;
import java.util.Scanner;
public class PrintPairOfThirty {
public static void main(String[] args) {
Scanner sc = new
Scanner(System.in);
int numbers[] = new int[10];
System.out.println("Enter 10
numbers below");
for(int i=0;i<10;i++){
numbers[i] =
sc.nextInt();
}
System.out.println(" Pair with sum
30 are as below ");
for(int i=0;i<10;i++){
for(int
j=i+1;j<10;j++){
if(numbers[i]+numbers[j]==30){
System.out.println("("+numbers[i]+","+numbers[j]+")");
}
}
}
}
}
output:
Write a Java program that reads 10 integers from the keyboard and outputs all the pairs...
Write a program that reads k integers and displays their sum. Write a program that reads k values representing family income from the keyboard and place them into the array. Find the maximum income among these values. Count the families that make less than 10 percent of the maximum income. (JAVA)
Write java program that prompts the user to enter integers from the keyboard one at a time. Program stops reading integers once the user enters the same value three times consecutively. Program then outputs "Same entered 3 in a row. "
write a in c++ program that reads in two integers from cin and outputs all of the integers between those values, except powers of three. You can assume that the first value is strictly less than the second value.
Task 1 : Write a Java program that prompts for and reads 10 integers from the user into an integer array of size 10, it then: - calculates the sum and average of positive numbers of the array and displays them. [Note: consider 0 as positive] Note: The program must display the message: "There are no positive values" if the array does not contain any positive value.
Write a Java program that reads four integers and prints "two pairs" if the input consists of two matching pairs (in some order) and "not two pairs" otherwise. For example, 1 2 2 1 two pairs 1 2 2 3 not two pairs 2 2 2 2 two pairs
1. Write a program that reads a sequence of numbers from the keyboard, and displays the smallest number. The sequence has at least one number and is terminated by -999(-999 will not appear in the sequence other than as the end marker). 2. Write a program which requests an integer input n from the keyboard and computes the sum of square of k for all k from 1 to n(inclusive). use java
Q1. CLO: (5 points) Write a java program that reads 10 words from the keyboard then place them in an array. Display the array elements in reverse order, and then count and print the number of times a word appears in that array. The user shall insert the word from the keyboard.
Part A Write a Java program that reads an integer n from the keyboard and loops until −13 ≤ n ≤ 13 is successfully entered. A do-while loop is advised. Part B Write a Java program that reads an integer n from the keyboard and prints the corresponding value n!. [This is n factorial]. You must verify that the input integer satisfies the constraint 0 ≤ n ≤ 13; keep looping until the constraint is satisfied. Will give thumbs up...
Q1. Write a C++ program that reads two integers a, and, b on the keyboard to calculate: U = (a + b)2 and V = (a - b)2 Q2. Write a C++ program to read a sequence of positive integers and to display the largest integer of that sequence. Use a negative integer to indicate the end of the data entry.
Write a Java program that reads in a word from the user and outputs each character of the word on a separate line. For example, if the user enters the input "Joe", your program should output: J o e You need to use a for-loop.