Answer Posted / adarsh
Scanner sc=new Scanner(system.in);
Int i,j=0;
String S1=sc.next(),s2;
S2=s1charAt(0);
For(i=1;i<s1.length;i++)
{
If(s2.charAt(j).equals (s1.charAt(i))
Continue;
Else{
S2=s2.concat(s1.charAt(i));
j++;
}
}
Sop(j);
}
I m writing with my mobile phone so chuck the mistakes like upercase nd lowr case...
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Is stringwriter thread safe?
Explain java thread life cycle.
How are the elements of a gridbaglayout organized?
Is simpledateformat safe to use in the multithreaded program?
Should a main method be compulsorily declared in all java classes?
What is public static void main?
what is the difference between a threads start() and run() methods? : Java thread
Explain about field hiding in java?
what is thread? : Java thread
What is java command?
whatis Home interface and Remoteinterface? with example?
How the interruptible method gets implemented?
What is codebase?
What is the full form of jpeg?
What is the full name of java?