Write a program to input a String and Convert it in UPPER CASE and replace all vovel of String with the charactor followed by vovel. #JAVA
/* QUESTION : Write a program to take input of a String, Convert it in UPPER CASE and replace all vovel of String with the charactor followed by vovel. Example : INPUT STRING : Computer OUTPUT STRING : CPMPVTFR */
checkout Stone Paper Scissor Game code : click here
checkout Stone Paper Scissor Game code : click here
package com.company; import java.util.Locale; import java.util.Scanner; public class shivam_program_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Input a String : "); String str = sc.nextLine(); System.out.println("Input String is :" + str ); str = str.toUpperCase(); int i,l,temp; l = str.length(); String newstr = ""; char ch; for ( i = 0 ; i < l ; i++ ) { ch = str.charAt(i); if( ch=='A' || ch=='E' || ch=='I' || ch=='O' || ch=='U' ) { temp = (int)ch + 1; ch = (char)temp; } newstr = newstr + ch; } System.out.println("New String : " + newstr); } }
Thanks Dosto for Reading this blog.
I think you all are definitely thinking of being connected with me.
Instagram : https://www.instagram.com/thetechdcode/
Facebook Page : https://www.facebook.com/thetechdcode
Twitter : https://twitter.com/thetechdcode
Telegram Channel : https://t.me/thetechdcode
YouTube : https://www.youtube.com/channel/UCjJnEdeugftBwQ3yMuD4B_A
Tech DCode Linktree : https://linktr.ee/thetechdcode
My Personal Handles : https://linktr.ee/virtualshivamin
Social Media Links of SHIVAM SINGH (OWNER) :
Instagram : https://www.instagram.com/virtualshivamin/
Facebook Page : https://www.facebook.com/virtualshivamin/
Twitter : https://twitter.com/virtualshivamin/
Personal Linktree : https://linktr.ee/virtualshivamin