Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add peach12389(neha bindal) as contributor :) (#209)
* add peach12389(neha bindal) as contributor :) * Update README.md * Update README.md * Update and rename day22.java to day2_neha.java
- Loading branch information
1 parent
d00d4ee
commit 568d1f7
Showing
2 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* To change this license header, choose License Headers in Project Properties. | ||
* To change this template file, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package day22; | ||
|
||
/** | ||
* @date 29/01/2019 | ||
* @author nehabindal | ||
*/ | ||
import java.util.*; | ||
public class day22 { | ||
public static void main(String[] args) | ||
{ | ||
System.out.println("Input a string to check it it's a pallindrome or not"); | ||
Scanner sc = new Scanner(System.in); | ||
String st = sc.nextLine(); | ||
int l = st.length(); | ||
int flag=0; | ||
for(int i=0;i<l/2;i++) | ||
{ | ||
if(st.charAt(i)!=st.charAt(l-1-i)) | ||
{ | ||
flag=1; | ||
} | ||
} | ||
if(flag==1) | ||
{ | ||
System.out.println("Not a pallindrome"); | ||
} | ||
else{ | ||
System.out.println("Yay a pallindorme"); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters