You are on page 1of 3

Task 1

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

Scanner mult = new Scanner(System.in);

int x = mult.nextInt();

int y = mult.nextInt();

int rez = 0;

for (int i = 0; i<x; i++) {

rez += y;

System.out.print(rez);

Task 3

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

int large = 0;

int input = 0;

Scanner in = new Scanner(System.in);

while ((input = in.nextInt()) != 0) {

if (input > large)

large = input;

System.out.println("The largest integer is: " + large);

}
Task 5

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

int sum = 0;

int input = 0;

Scanner in = new Scanner(System.in);

while ((input = in.nextInt()) != 0) {

if (input % 2 == 1)

sum = input + sum;

System.out.println(sum);

Task 7

import java.util.Scanner;

public class Main {

public static void main(String[] args)

Scanner in = new Scanner(System.in);

String str = in.nextLine();

str = str.toLowerCase();

int count = 0;

for (int i = 0; i < str.length(); i++) {

if (str.charAt(i) == 'a' || str.charAt(i) == 'e'

|| str.charAt(i) == 'i'

|| str.charAt(i) == 'o'

|| str.charAt(i) == 'u') {

count++;

}
}

System.out.println(

"Total no of vowels in string are: " + count);

Task 9

import java.util.Scanner;

public class Main {

public static void main(String[] args)

Scanner in = new Scanner(System.in);

String strw = " ";

String strf = in.nextLine();

String strs = in.nextLine();

strf = strf.toLowerCase();

strs = strs.toLowerCase();

for (int i = 0; i < strf.length(); i++) {

if (strf.charAt(i) == strs.charAt(i)) {

strw = "Yes";

else {

strw = "No";

System.out.println(strw);

You might also like