aparna nimmagadda
string program
1 Answer(s)      a year and 3 months ago
Posted in : Java Beginners

write a program to print the pattern

     p
     r
     o
  program
     r
     a
     m
View Answers

February 24, 2012 at 1:08 PM


class StringPattern{
    public static void main(String[] args){

        String st="program";
        char ch[]=st.toCharArray();
        for(int i=0;i<ch.length;i++){
            if(i==3){
            for(int j=0;j<ch.length;j++){
                System.out.print(ch[j]);
            }
            }
            for(int j=1;j<=3;j++){
            System.out.print(" ");
            }
            System.out.println(Character.toString(ch[i]).replace('g',' '));
            }
    }
}









Related Pages:
string program
string program  write a program to print the pattern p r o program r a m
string program
string program  reads sentence and find the average length of word... AverageLengthOfWords { public static void main(String[] args...); System.out.print("Enter sentence: "); String st=input.nextLine(); String str
string
string  write a program to accept the string and store the reverse stream into another array and print
String
String  write a program using string it should replace 'c'char to integer number as 1 in whole source
string
string  a java program using string function to input any string... ArrangeStringAlphabetically { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter string
string
string  a java program to replace all matching substrings
string
string  a java program to input a string and display the string...*; import java.io.*; public class FirstLetter{ public static String capitalizeFirstLetter( String str ) { final StringTokenizer st = new StringTokenizer( str
string
string   just i want to a program in a short form to the given string in buffered reader for example input string: Suresh Chandra Gupta output: S. C...; public class StringTest { public static void main(String [] args
string
string  a java program using string function that computes your initials from your full name and display them   Please visit the following links: http://www.roseindia.net/tutorial/java/core/printInitials.html http
string
string  program for String reverse and replace in c,c++,java e.g.Input:10,20,hello output:hello;20;10   Hi Friend, Try the following java...(String[] args) { String array[]=new String[5]; Scanner input
string
string  a java program using string function and access modifiers to automate the insurance company which will have to manage the information about policy holders Data Members: 1)Policy No 2)Name of policy holder 3)Address 4
String program - Java Beginners
String program  write a program to accept a word. Pass it to the function magic(String x). The function checks the string for the presence... prints it is a magic string otherwise it prints not a magic string.  
java string vowel program
java string vowel program  java string vowel program   Please visit the following links: Display the word that begins with vowel Java Count Vowels
String reverse program
String reverse program  write a java program for reverse string? if the string is "Hi welcome to hyderabad" the reverse string is "hyderabad... for help. You can split the String into String array using split method of String
String Function Program
String Function Program  The string function program is just an application of the string manipulation functions in JAVA. The program is designed to count the number of one-letter word, two-letter word, and three-letter words
Program to swap the string
Program to swap the string  Hi, can any one tell me the code to swap...!!   Here is an example that prompts the user to enter two string and then swaps both the string without using third variable. import java.util.*; class
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
java program for string tokenzing and parsing
java program for string tokenzing and parsing  String s="height=128 weight=22 gender=male"; i need to convert this into height="128" weight="22" gender="male" normally if we print "hello" means we use System.out.println("\"Hello
java program for string tokenzing and parsing
java program for string tokenzing and parsing  String s="height=128 weight=22 gender=male"; i need to convert this into height="128" weight="22" gender="male" normally if we print "hello" means we use System.out.println("\"Hello
program
program  write a program reversee a string. input-hi this is roseindia output-roseindia is this hi
A Program To Reverse Words In String in Java
A Program To Reverse Words In String in Java  A Program To Reverse Words In String in Java for example: Input:- Computer Software Output... Tell Me This Program.  Here is an example that reverse the words
String Exception Program - JSP-Servlet
String Exception Program  Respected Sir/Madam, I am... the code for your kind reference: <% int val =0; String contentType..., totalBytesRead, formDataLength); totalBytesRead += byteRead; } String file = new
program
program  Write a program to print details of a week for a particular day using array of objects Integer and String. OUTPUT: First Day of Week... Seventh Day of Week is Sunday Note: Use two dimensional array of String
Program
?? using string Buffer class and perform the following operations. i) Append s1 and s2. ii) Reverse string s1. iii) Find length of string s1 and s2. iv) Replace string s1 to â??Simpleâ??. v) Extract 0th to 6th character from string s2 into s3
program
program  Given a string and a number ââ?¬Ë?nââ?¬â?¢, find the ââ?¬Ë?nââ?¬â?¢th distinct repeating character
program
an example of your problem. public class College { String str = "IIT...); } public static void main(String args[]) { College
Program
import="java.util.*"%> <% String id[]= new String[10]; for(int i=0;i<10;i++){ id[i]=request.getParameter("radio"+i); } String str[]= new String[10
program
{ // Getting query String qry; qry = req.getParameter
Java String Occurrence in a String
. Description of the code: In the program code given below, we will find another String... Java String Occurrence in a String       In this program you will learn how to find the occurrence
Program using String functions - Java Beginners
Program using String functions  Write a program to accept a sentence... { public static void main(String[] args) { int count = 0...); System.out.print("Enter string:"); String st = input.nextLine
string manipulation
string manipulation  Write a program in java and accept 10 strings form the user. store them in an array. then find the string with the maaximum length and print
string prgm
string prgm  write a java program which read a sentence and print occurence of each vowels in it seperatly
string manipulation
string manipulation  write a java program that asks the user to enter a string(where a consonant means insert, a punctuation means return element... empty priority queue.The program will output the sequence of values returned
string manipulation
string manipulation  write a java program that asks the user to enter a string(where a consonant means insert, a punctuation means return element... empty priority queue.The program will output the sequence of values returned
string object
string object  Hi, how do i write a program that works with a user's password, when the program should prompt the user for a possible password, that is between 6 and 10 characters long, that contains at least one letter
searching string
searching string   how to write a program for searching a string...{ public static void main(String[] args){ Scanner input=new Scanner(System.in); System.out.println("Enter string: "); String str = input.nextLine
integer to string
integer to string  i have to develop a program which convert integer into character from 1 to 10,000 if we input 1 then it give output 'one' n so on till 'ten thousand' kindly give me the codes plzplz sir........   Have
String Array
are widly used in java program for a sequence of character. String are represents character string. This program are implemented such as "rose!"... in this program we are going to use string type array. We have to used array as data
Out of bounce exception in the string reverse program - Java Beginners
Out of bounce exception in the string reverse program  In the given program below this is taken from ur site but when i am executing it.It is giving an exception like string out of bounce.So please give me the correct solution
String valueOf()
String valueOf()      ...() method of String class. We are going to use valueOf() method of String class.... Description of the code: This method creates a new String object containing
String lastIndexOf(String str)
java program. In the program code given below, we have taken a String. To find... String lastIndexOf(String str)     ... the lastIndexOf(String str) method of String class. We are going to use
String indexOf(String str)
about the indexOf(String str) method through the following java program. In the program code given below, we have taken a String. To find the index... of the given substring within the string. Here is the code of the program
String equalsIgnoreCase(String Str)
String equalsIgnoreCase(String Str)   ... explanation about the equalsIgnoreCase(String Str) method of String class. We are going to use equalsIgnoreCase(String Str) method of String
I am writing a program which converts a string to a timestamp and add days to it
I am writing a program which converts a string to a timestamp and add days to it  java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2012-01-11 12:34:39"); long l=ts2.getTime() +(100060602424);//add 24 days Date d=new Date(l
Example - Array to String
Java: Example - Array to String Here is a simple, but slow, program to concatenate all of the strings in an array, each separated by a specifed string...() // Convert an array of strings to one string. // Put the 'separator' string
String replaceAll() Method
String replaceAll() Method       In this program you will learn how to replace all the words in a String. We are going to use replaceAll() method of String class in Java

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.