Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
20 views
10 pages
String Programmes
Uploaded by
meghana j
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save String_programmes For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
0 ratings
0% found this document useful (0 votes)
20 views
10 pages
String Programmes
Uploaded by
meghana j
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save String_programmes For Later
Share
0%
0% found this document useful, undefined
0%
, undefined
Print
Embed
Report
Download
Save String_programmes For Later
You are on page 1
/ 10
Search
Fullscreen
Factorial java 2) PrimeNumbers,java O) Recurrsionjava i Test2java (| test3java 52 | i 1 package string; 2. 3 public class test3 { 4-public static void main(String[] args) { 5. String s ="a2b3c4"; 6 String[] a=s.split(""); 7 for (int i = 1; i < a.length; i+=2) { 8 int x=Integer.parseInt(a[i]); 9 for(int j=0;j
test3 (1) Java Application] C:\Program Files\VJava\jre1.8.0_162\bin\javaw.exe (26-Nov-2022, 8:2 aabbbcccc1 package string;//to verify phone number Zz: 3 import java.util.Scanner; 4 5 public class Test4 { 6°public static void main(String[] args) { 7 Scanner sc=new Scanner(System. in); 8 System.out.print1n("Enter 10 digit number"); 5 String s=sc.next(); 10 int flag=0; 11 for(int Bix): 12 if (s.length()==10) { 13: System.out.println("Thank you"); 14 Fflag++; 15 break; 16 } ay else { 18 System.out.println("Retry"); 19 s=sc.next(); 20 } 21 22) if(flag==0) { 23 System.out.println("Sorry,tries are over,Try after some time”); 24 } 25'|} 26:\} 27 |i Gi Factorialjava 7) PrimeNumbersjava J) Recurrsionjava__‘L| Test2java_ ‘Ui test3java «i Test4java | Ss I 1 package string;//to find even and odd words 2 3 public class Test5 { 4°public static void main(String[] args) { 5 String s="hello this is daksha from mysore"; 6 String[] a=s.split(" "); a; int even =@; 8 int odd=0; 9 for (int i = @; i < a.length; i++) { 10 if(a[i].length()%2==0) { e1 event+; 12 } a3 else { 14 odd++; 15 } 16 % 17 System.out.println("There are “+even+” even words”); 18 System.out.println("There are “+odd+" odd words"); 19 } 20 } 21G)Fectorialjeva [7 PrimeNumbersjava__[2) Recurrsionjava | [J) Test2java T 1 package string; 2 3 public class Test2 { 4s public static void main(String[] args) { 5 String s ="a2b3c4"; 6 String[] a=s.split(""); 7 for (int i = 1; i < a.length; i+=2) { 8 int x=Integer.parseInt(a[i]); 9 for (int j = @; j
Test2 [Java Application] C:\Program Files\Java\jret 80_162\bin\javaw.exe (26-Nov-2022, 8:21:36 PM) aabbbcccc|B PrimeNumber... 2) Recurrsionjava Gi Test2java Ditest3java 4) Test4 java a I 1 package string;//reversing a string 2 3 import java.util.Scanner; aNnau a public class Test6 { *public static void main(String[] args) { System.out.println("Enter the string"); String s=sc.next(); String temp=""; for (int i = s.length()-1; i >=0; i--) { tempt=s.charAt(i); } System.out.println(temp) ;3 B)Recursionjava [A Test2java ‘(Li test3java LA Test4java ‘( TestSjava _{) Test6 java ~ [| 1 package string;//palindrome program 2 3 import java.util.Scanner; 4 5 public class Test7 { 6°public static void main(String[] args) { ue 7 8 9 1e te 12 13 14 15 16 17 18 19 20 } 21 } 99 Scanner sc=new Scanner(System.in); System.out.println("“Enter the string"); String s=sc.next(); String temp=""; for(int i=s.length()-1;i>=0;i--) { tempt=s.charAt(i); 3 if (s.equals(temp)) { System.out.println("Palindrome”) ; } else { System.out.println("Not a Palindrome"); 3Ov Ea~R~iS~ OVS 9~' PA oe BE 1: @B Br Hv eoro~ Sh Test2java Dtest3java !) Test4java DtestSjava i) Test6java L)Test7java fi) Test8jav “ l i package string;//case conversion 3 import java.util.Scanner; B 5 public class Test8 { 6°public static void main(String[] args) { a7 Scanner sc=new Scanner (System. in); 8 System. out.println("“enter the string”); 9 String s=sc.next(); 18 String temp a1 for (int i = 0; i < s.length(); i++) { 12 13 if(Character.isLowerCase(s.charAt(i))) { 14 temp+=Character.toUpperCase(s.charAt(i)); 15 } 16 else { 7 temp+=Character.toLowerCase(s.charAt(i)); 18 } 19 } 20 System. out.println(temp) ; 20 |} yt ms © Console 28Dtest2java Ditest3java Di Test4java Wi TestSjava UI Test6java A Test7java : I 1 package string;//reversing word and letters 2 3 import java.util.Scanner; 4 5 public class Test9 { 6°public static void main(String[] args) { m7 Scanner sc=new Scanner(System.in) ; 8 System.out.print1In("Enter the string"); 9 String s=sc.nextLine(); 10 String[] a=s.split(" "); 11 String temp=""; 12 for (int i =a.length-1; i >=@; i--) { 13 String[] x=a[i]-split(""); 14 for (int j = x.length-1; j >=0; j--) { 15 temp+=x[j]; 16 17 temp+="_"; 18 } 19 System. out.print1n(temp) ; 20 } pai a ns Ei Console Prop Explorer {& Snippets [ProJtest3java J) lest4java J) lestoyava J lestojava— il lest/yava iJ lest8java—— 4) lest¥yava a package string;//Reversing sentence and words method 2 2 3 import java.util.Scanner; 4 5 public class Test1e { 62 public static void main(String[] args) { zZ Scanner sc=new Scanner(System.in); 8 System.out.println("Enter the string"); 9 String s=sc.nextLine(); 10 String[] a=s.split(" "); 10) for (int i =a.length-1; i >=0; i--) { 12 String x=a[i]; 13 String tem 14 for (int j = x.length()-1; j >=0; j--) { 15 temp+=x.charAt(j); 16 } 17 System.out.print(temp+” “); 18 } 19 ay 20 } 21 wz ers Wi Data Source Markers [Properties Snippets [fl Problems & Console 2%1 package string;//anagram=characters in string1 should be same as characters in string2 2 3° import java.util.Arrays;(] 5 6 public class Testi1 { 7epublic static void main(String[] args) { 8 Scanner sc= new Scanner(System. in); 9 System.out.printin("Enter Stringi"); 10 String s1=sc.next(); 11 System.out.printin("Enter String2"); 12 String s2=sc.next(); 43 if (s1.length()==s2.length()) { 14 s1=s1.toLowerCase(); 15 $2882. toLowerCase(); 16 char[] t1=s1.toChararray(); 17 char[] t2=s2.toChararray(); 18 Arrays.sort(t1);| 19 Arrays.sort(t2); 28 boolean b=true; 21 for (int i = @; i < t2.length; i++) { 22 if(ti[i]!=t2[i] ){ 23 b=false; 24 } 25 } 26 if(b) { 27 System. out. print1n("Anagram") ; 28 ¥ 29 else { 30 System.out.print1n("Not a anagram"); 31 32 33 } 34 else { 35 System.out.print1n("Not a anagram"); 36 } 37 } 38 }
You might also like
Peer-E-Kamil - by Umera Ahmed (Roman Urdu Translation by Sk. Danish) Malgun Gothic1
PDF
96% (134)
Peer-E-Kamil - by Umera Ahmed (Roman Urdu Translation by Sk. Danish) Malgun Gothic1
492 pages
I Fell in Love With Blind Man 1 To 50
PDF
91% (23)
I Fell in Love With Blind Man 1 To 50
826 pages
Bad Life (VOL 1-4)
PDF
91% (11)
Bad Life (VOL 1-4)
788 pages
Class 11 Business ST Ch-2 Notes
PDF
55% (11)
Class 11 Business ST Ch-2 Notes
25 pages
400+ Love Shayari in English - Romantic, Sad, Girlfriend & Boyfriend
PDF
No ratings yet
400+ Love Shayari in English - Romantic, Sad, Girlfriend & Boyfriend
65 pages
Kuch Nahi Ho Ga (Incest)
PDF
65% (26)
Kuch Nahi Ho Ga (Incest)
401 pages
11th English Guide - Unit 1 and 2 - Way To Success
PDF
69% (16)
11th English Guide - Unit 1 and 2 - Way To Success
78 pages
Psycho Fae
PDF
91% (11)
Psycho Fae
402 pages
The Graham Effect Campus Diaries Book 1 Elle Kennedy Z Library
PDF
86% (14)
The Graham Effect Campus Diaries Book 1 Elle Kennedy Z Library
329 pages
7th Time Loop 05
PDF
91% (22)
7th Time Loop 05
276 pages
Save Me in English - Mona Kasten
PDF
90% (21)
Save Me in English - Mona Kasten
286 pages
You Amp Me - Tal Bauer
PDF
80% (10)
You Amp Me - Tal Bauer
304 pages
Module in Purposive Communication 1 First Year College
PDF
90% (58)
Module in Purposive Communication 1 First Year College
91 pages
Certificate - 2025 Navodaya Vidyalaya Samiti
PDF
73% (11)
Certificate - 2025 Navodaya Vidyalaya Samiti
1 page
Celebrity Format For Billing Clients On Donation
PDF
84% (92)
Celebrity Format For Billing Clients On Donation
2 pages
Lord of The Mysteries 1
PDF
100% (5)
Lord of The Mysteries 1
865 pages
Fortis Advisors v. Krafton Via Aftermath
PDF
82% (17)
Fortis Advisors v. Krafton Via Aftermath
58 pages
The Girl in The Green Dress - Jeni Haynes, George Blair-West
PDF
100% (5)
The Girl in The Green Dress - Jeni Haynes, George Blair-West
401 pages
ADDICTED (The Novel) Book 1 - The Original English Translation
PDF
93% (15)
ADDICTED (The Novel) Book 1 - The Original English Translation
1,788 pages
Wind and Truth The Brand New Epic Stormli Brandon Sanderson
PDF
100% (3)
Wind and Truth The Brand New Epic Stormli Brandon Sanderson
1,592 pages
All Format
PDF
83% (18)
All Format
1 page
Dispenza - Breaking The Habit of Being Yourself PDF
PDF
99% (104)
Dispenza - Breaking The Habit of Being Yourself PDF
360 pages
Mera Nam Ahsan He or Mere Ghar Me Ham 5 Log Hain
PDF
67% (15)
Mera Nam Ahsan He or Mere Ghar Me Ham 5 Log Hain
9 pages
Read People Like A Book by Patrick King-Edited
PDF
59% (116)
Read People Like A Book by Patrick King-Edited
12 pages
Jawani Ka Nasha
PDF
66% (182)
Jawani Ka Nasha
3,571 pages
1500 Vocabulary Words
PDF
80% (74)
1500 Vocabulary Words
27 pages
New Microsoft Office Word Document
PDF
67% (3)
New Microsoft Office Word Document
115 pages
Acknowledgement Receipt
PDF
88% (191)
Acknowledgement Receipt
1 page
ORAL COM 11 Quarter 1 Module 1 PDF
PDF
88% (170)
ORAL COM 11 Quarter 1 Module 1 PDF
37 pages
XXX BP
PDF
100% (2)
XXX BP
10 pages