Home
(current)
About
Tutorial
Technologies
C#
Deep Learning
Statistics for AIML
Natural Language Processing
Machine Learning
SQL -Structured Query Language
Python
Ethical Hacking
Placement Preparation
Quantitative Aptitude
View All Tutorial
Quiz
C#
SQL -Structured Query Language
Quantitative Aptitude
Java
View All Quiz Course
Q & A
C#
Quantitative Aptitude
Java
View All Q & A course
Programs
Articles
Identity And Access Management
Artificial Intelligence & Machine Learning Project
How to publish your local website on github pages with a custom domain name?
How to download and install Xampp on Window Operating System ?
How To Download And Install MySql Workbench
How to install Pycharm ?
How to install Python ?
How to download and install Visual Studio IDE taking an example of C# (C Sharp)
View All Post
Tools
Program Compiler
Sql Compiler
Replace Multiple Text
Meta Data From Multiple Url
Contact
User
Login
Register
FRESHER BELL ALL LANGUAGE ONLINE COMPILER
Write a program to find anagram or two words of same letter
Languages
Java
C
C-99
C++
C++ 14
C++ 17
PHP
Perl
Python 2
Python 3
Ruby
Go Lang
Scala
Bash Shell
SQL
Pascal
C#
VB.NET
Haskell
Objective C
Swift
Groovy
Fortran
Brainf**k
Lua
TCL
Hack
Rust
D
Ada
R Language
Free Basic
Theme
github
xcode
ambiance
monokai
chaos
chrome
Program
import java.util.Arrays; import java.util.Scanner; public class minmax { public static void main(String[] args) { Scanner sc=new Scanner(System.in); System.out.println("Enter sentence 1"); String s1=sc.next(); s1=s1.toLowerCase(); System.out.println("Enter sentence 2"); String s2=sc.next(); s2=s2.toLowerCase(); if(s1.length()!=s2.length()) { System.out.println("Invalid"); } if(s1.matches("^[a-zA-Z]*")){ char c1[] = s1.toLowerCase().toCharArray(); char c2[] = s2.toLowerCase().toCharArray(); Arrays.sort(c1); Arrays.sort(c2); if (Arrays.equals(c1, c2)) { System.out.println(s1 + " and " + s2 + " contain the same characters"); } else { System.out.println(s1 + " and " + s2 + " contain the different characters"); } } else { System.out.println("Invalid"); } } }
Run
Clear
Input
cat act
Output
Powered By Fresher Bell™
Similar Program
#
Program
Language
1
Java For Loop Example
Java
2
Java Program to multiply two decimal number ( floating number ) by taking input from user
Java
3
Java program to check whether the user input is alphabet or not
Java
4
Java For Each Loop Example
Java
5
Java Hierarchical Inheritance Example
Java
6
Java Left Shift Operator Program
Java
7
Java Switch Case Example
Java
8
Write a java program to find the lcm .Given input in the form of day interval of dinner. Find the day on which they both will lunch together / dinner together.
Java
9
Java Unary Operator Negating Example
Java
10
Java Multilevel Inheritance Example
Java
11
Java Right Shift Operator Example
Java
12
Write a java program to find summation of even numbers in the array
Java
13
Java program to find largest element of array
Java
14
Java program to add element to ArrayListv and get size of it
Java
15
Java program to generate left angled triangle or left half pyramid using number and for loop
Java
16
Java Unary Operator Boolean Inverting Example
Java
17
Java Multiple Object Example
Java
18
Java program to generate right angled triangle or half pyramid using number and for loop
Java
19
Java Program to add two integer by taking input from user
Java
20
Java While Loop Example
Java
#
Program
Language
Copyright © 2020
Inovatik
- All rights reserved