Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Wipro Talent Next 2021

ARRAYS-ASSIGNMENT
1 class Main {
public static void main(String[] args){
System.out.println(args[0]+"Technologies"+args[1]);

}
}

2 class Main {
public static void main(String[] args){
System.out.println("Welcome"+args[0]);

3 class Main {
public static void main(String[] args){
System.out.println("The Sum
of"+args[0]+"and"+args[1]+"is"+Integer.toString(Integer.parseInt(args[0])+Integer.parseInt
(args[1])));
}
}

A class Main {
public static void main(String[] args){
Scanner scanner=new Scanner (System.in);
int num = scanner.nextInt();
if(num>0
System.out.println("positive Number");
else if(num<0)
System.out.println("Negative Number");
else
System.out.println("zero");
scanner.close();

}
}
B class Main {
public static void main(String[] args){
int num1;
int num2;
Scanner sc=new Scanner (System.in);
num1=sc.nextInt();
num2=sc.nextInt();
if (num1%10==num2%10)
System.out.println("true");
else
System.out.println("false");
sc.close();

}
}
2 class Main {
public static void main(String[] args){
int num1;
Scanner sc=new Scanner (System.in);
num1=sc.nextInt();
if (num1%2==0)
System.out.println("Even");
else
System.out.println("Odd");
sc.close();

}
}
`

3 class Main {
public static void main(String[] args){
if(args.length==0)
System.out.println("No Values");

else
for(int i=0;i<=args.length;i++)
{
System.out.println(args[i]+",");
}
}
}

4 class Main {
public static void main(String[] args){
char ch1='a';
char ch2='e';
if(ch1>ch2)
System.out.println( ch2+ "," + ch1);
else
System.out.println(ch1+","+ch2);
}

5 class Main {
public static void main(String[] args){

char ch;
Scanner s=new Scanner(System.in);
ch=s.next().charAt(0);

if((ch>='A'&&ch<='Z')||(ch>='a'&&ch<='z'))
System.out.println("ALPHABET");
else if(ch>='0' && ch<='9')
System.out.println("Digit");
else
System.out.println("special Character");
}
}
6 public static void main(String[] args){

String gender=args[0];
int age=Integer.parseInt(args[1]);
if(gender=="Female"||gender=="FEMALE"||gender=="female") {
if (age >= 1 && age <= 58) {
System.out.println("percentage of interest is 8.2%");
} else if (age >= 59 && age <= 120)
System.out.println("percentage of interest is 7.6");
}
if(gender=="male"||gender=="MALE"||gender=="Male") {
if (age >= 1 && age <= 60) {
System.out.println("percentage of interest is 9.2%");
} else if (age >= 61 && age <= 120)
System.out.println("percentage of interest is 8.3");
}

}
}

7 class Main {
public static void main(String[] args) {

char ch;
char ch1;
Scanner s = new Scanner(System.in);
System.out.println("enter the character");
ch = s.next().charAt(0);
if ((ch>='A') && (ch<='Z')) {
ch1= (char) (ch+32);
System.out.println("the lowecase of the alpahbet" +ch+"is"+ ch1);
} else if ((ch>='a' && ch<='z')) {
ch2= (char) (ch-32);
System.out.println("the uppercase of the alpahbet " +ch+ "is"+ ch2);
}
8
class Main<ch> {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("Enter the colour code");
char ch=s.next().charAt(0);
if(ch=='r'||ch=='R')
{
ch='R';
}
else if(ch=='B'||ch=='b')
{
ch='B';
}
else if(ch=='G'||ch=='g')
{
ch='G';
}
else if(ch=='Y'||ch=='y')
{
ch='Y';
}

else
{
ch='W';
}
switch(ch){
case 'R':
System.out.println("red");
break;
case 'B':
System.out.println("Blue");
break;
case'G':
System.out.println("green");
break;
case 'Y':
System.out.println("yellow");
break;
case'W':
System.out.println("White");
break;
default:
System.out.println("Invalid code");
s.close();
}

9 class Main<ch> {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("Enter the Month");
int m=s.nextInt();
switch(m){
case 1:
System.out.println("JANUARY");
break;
case 2:
System.out.println("FEBRAURY");
break;
case 3:
System.out.println("MARCH");
break;
case 4:
System.out.println("APRIL");
break;
case 5:
System.out.println("MAY");
break;
case 6:
System.out.println("JUNE");
break;
case 7:
System.out.println("JULY");
break;
case 8:
System.out.println("AUGUST");
break;
case 9:
System.out.println("SEPTEMBER");
break;
case 10:
System.out.println("OCTOBER");
break;
case 11:
System.out.println("NOVEMBER");
break;
case 12:
System.out.println("DECEMBER");
break;
default:
System.out.println("Invalid code");
s.close();
}

10 class Main{
public static void main(String[] args) {
for(int i=0;i<=10;i++) {
System.out.print(i+"\t");
}
}

11 class Main{
public static void main(String[] args) {
for(int i=23;i<=57;i++) {
if(i%2==0)
System.out.println(i+"\t");
}
}
}

12 class Main {
public static void main(String[] args) {
int count = 0;
for (int i =10; i <= 99; i++)
for (int j = 1; j <= i; j++)
if (i % j == 0)
count++;
if(count==2)
System.out.println("prime number");
else
System.out.println("not a prime number");
}
}

13 class Main {
public static void main(String[] args) {
int r;
int sum=0;
Scanner s = new Scanner(System.in);
int n = s.nextInt();
while (n > 0) {
r=n%10;
sum=sum*10+r;
n=n/10;
}
System.out.println(sum);
}
}
14 class Main {
public static void main(String[] args) {
int temp = 0;
int sum = 0;
Scanner s = new Scanner(System.in);
int n = s.nextInt();
while (n > 0) {
temp = n % 10;
sum = sum + temp;
n = n / 10;
}
System.out.println(sum);

}
}

15 public class Main {


public static void main(String[] args) {
Scanner s = new Scanner(System.in);
int n = s.nextInt();
for (int i = 0; i <= n; i++) {
for (int j = 0; j <=i; j++) {
System.out.print("*");

}
System.out.println();
}
}
}

16 class Main {
public static void main(String[] args) {
int r;
int sum = 0;
Scanner s = new Scanner(System.in);
int n = s.nextInt();
while (n>0) {
r = n % 10;
sum = sum * 10 + r;
n = n / 10;
}
Sysyem.out.println(sum);
}
}
17 class Main{
public static void main(String[] args) {
int r;
int sum = 0;
Scanner s = new Scanner(System.in);
int n = s.nextInt();
int temp = 0;
temp=n;
while (n>0) {
r = n % 10;
sum = sum * 10 + r;
n = n / 10;
}
n=temp;
if (n == sum)
System.out.println("palindrome");
else
System.out.println("not a palindrome");
}

You might also like