import java.util.*;
class Char
{
public static void main(String r[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter number of characters: ");
int n=sc.nextInt();
String in[]=new String[n];
for(int i=0;i<n;i++)
{
in[i]=sc.next();
}
for(int i= 0;i<n;i++)
{
if(in[i].equals("dle"))
{
in[i]="dle dle";
}
}
System.out.println("Transmitted message is: ");
System.out.print(" dle stx ");
for(int i=0;i<n;i++)
{
System.out.print(in[i]+" ");
}
System.out.println(" dle etx ");
}
}
Example:
Sample output:
Enter number of characters:
5
a b dle dle d e
Transmitted message is:
dle stxa b dle dle dle dle d dle etx
Welcome guys................... This blog is basically created to accumulate and share as much knowledge i can share. I will try to cover as much of topic I can. So just post any program or concept you want to know related to any programming language, Tibco , Algorithm, OOPS, android etc. You are free to post any problem you may face in these programs just post a comment. If you are not able to make any program just post the details and it will be posted to this blog as soon as possible.
good explantion dude keep it up
ReplyDeletephython me uplaod karo example program
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteExcellent man
ReplyDelete