Java Program
Java Program
Java Program
Assignment 2
2. Accept 10 numbers from users and check how many of them are even and how many
odd.
4. Write Java program to count total number of words and the number of di erent
characters in a string.
6. WAP to print a user given sentence in reverse order (without using any library function
for that purpose).
7. WAP to print each word of a user given sentence in reverse order (without using any
library function for that purpose).
Q1. Find the largest among 3 user entered nos. using Java.
/*
Find the largest among 3 user entered nos. using Java.
*/
import java.util.*;
Q2. Accept 10 numbers from user and check how many of them are even and how many
odd.
/*
Accept 10 numbers from user and check how many of them are even and how
many are odd.
*/
import java.util.*;
Q4. Write Java program to count total number of words and the number of di erent
characters in a string.
/*
Write a Java program to count total number of words and the number of
different characters in a string.
*/
import java.util.*;
}
}
OUTPUT:
Q6. WAP to print a user given sentence in reverse order (without using any library
function for that purpose).
/*
WAP to print a user given sentence in reverse order (without using any
library function for that purpose.)
*/
import java.util.*;
Q7. WAP to print each word of a user given sentence in reverse order (without using any
library function for that purpose).
/*
WAP to print each word of a user given string sentence on reverse order
(without using any library function for that purpose.)
*/
import java.util.*;