Computer Science, asked by ishaansharma121, 1 year ago

Write a java program to accept a string and move its each alphabet one step ahead. if alphabet Is Z, it moves to A.

Answers

Answered by amannishad0512p5zxh6
0
class Move

{

public static void main( )

{

String a="IshaanSharma";

int i,l,move=1;

l=a.length( );

for( i=0;i<l;i++)

{
char
if(b=='z')

{

move=97;

}

else if(b=='Z')

{

move=65;

}

else

{

move=move+ch;

}

System.out.print(move);

}

}

Hope you will understood@

For more java doubts ,pls follow me@

amannishad0512p5zxh6: Bro, i have mistake in answer
amannishad0512p5zxh6: in the brainly it does not support
amannishad0512p5zxh6: char in answer i don t kniw why
Answered by nain31
2

CODING

import java . io .*;

class letter

{

public static void main(String args[])throws Exception

{

DataInputStream in=new DataInputStream(System . in);

String s,s1="";

char ch;

int i;

Sys  tem . out. println("Enter any string");

s=in . readLine();

s=s . toUpperCase();

for(i=0;i<s . length();i++)

{

ch=s . charAt(i);

if(ch>='A'&&ch<'Z')

{

if(ch=='Z')

s . replace('Z','A');

else

ch++;

}

s1=s1+ch;

}

System . out . println(s1);

}

}

OUT PUT

s=abcdz is the string entered by user.

s=ABCDZ is coverted into upper case

\large\boxed{s=BCDEA}

Similar questions