Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners To print initials
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Payush Khurana
To print initials
2 Answer(s)      3 years and 2 months ago
Posted in : Java Beginners


import java.util.Scanner; class initials { String a ; int e ; char f ; int b ; int c ; char d; Scanner sc = new Scanner(System.in);

      void main()
          {
              System.out.println("Please enter your name");
              a = sc.nextLine();
              b = a.length();
              System.out.println("The no of letters are :" + b);
              for (c = 0 ; c<=b ; c++)
                  {
                      d = a.charAt( c );
                      if (d==' ')
                      {
                          e=e+1;
                          f = a.charAt(e);
                          System.out.println("The initials are :" + f);
                        }
                    }
                }
            }
                        what is wrong in it ????

Advertisement
View Answers

August 1, 2011 at 10:56 AM




August 3, 2011 at 12:52 PM


i dont know that split function ..... so i want to know what is wrong in my coding /......



Related Tutorials/Questions & Answers:
To print initials
To print initials  import java.util.Scanner; class initials { String a ; int e ; char f ; int b ; int c ; char d; Scanner sc = new...); System.out.println("The initials are :" + f
print initials
print initials  How to print initials of a name without using arrays?   Hi Friend, You can try the following code: import java.util.*; public class InitialName { public static void main(String[] args
Advertisements
Print initials of the input name
Print initials of the input name In this section, you will come to know how to display the initials of the given name. For this, user will have to input the name. This name in the form of string is then split into the words with the split
print
print  How to print JFrame All Componant?   Please visit the following link: http://www.roseindia.net/java/example/java/swing/Print.shtml
Print
into the stream and, as opposed to print() method, gets you to the new line after the text
print a form of *
print a form of *   * *** ***** ******* ********* ******* ***** *** *   Post the format properly
print the newline
print the newline  Why doesn?t the following code print the newline properly? <?php $str = ?Hello, there.\nHow are you?\nThanks for visiting.?; print $str; ?>   Hi friends, Inside the single quotes \n (newline
print numbers
print numbers  1234 123 12 1234   1234 123 12 1234
Print the document
Print the document  I tried to print web page.I am using the below...() { var printWindow = window.open('test', 'Print Window', 'height=600,width...;Print Window</title>'); printWindow.document.write('</head>
Print the document
Print the document  I tried to print web page.I am using the below...() { var printWindow = window.open('test', 'Print Window', 'height=600,width...;Print Window</title>'); printWindow.document.write('</head>
Print a statement
Print a statement  hello what would we output for this statement System.out.println ("5"+"A" + 3);   hello output will be 5A3
print the sequence
print the sequence  how can I write the code by using for loop to produce this following statement: 10,9,8,7,6,5,4,3,2,1,buzz! please, help me
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
date print
date print  how can i print the date in jsp page in the following formate month-date-year. (example. march 8 2012
diamond print
diamond print   print the pattern 1 2 3 4 5 6 7 8 9 10 11 12
Print command
Print command  Can I use System.out.println command in Struts form bean or Struts action class. I am using Struts 1.3.8 but when I write this command. It does not work. Please reply me as soon as possible. Thanks.   
should print in console
should print in console  
print form information when click on print button
print form information when click on print button   Sir,I desingn institute webside using jsp and strut by using platform netbean 7.2.So request you please help for printing form information by clickin print button after submit
echo and print statement
echo and print statement  hello, What is the difference between echo and print statement
how to print the server time
how to print the server time  how to print the server time in jsp and update time in fix interval
print square of any number
print square of any number  using c++ language, write aprogram to print the square of any number entered by the user
echo and print statement
echo and print statement  hello, What is the difference between echo and print statement?   hii, echo() can take multiple expressions, Print() cannot take multiple expressions. And echo is a little bit faster
How to print this Format exactly?
How to print this Format exactly?   * * * & reverse
How to design a foot print on the sand, print on the sand, print
How to design a foot print on the sand       You might have seen foot prints on the sand field. Do you think, it can be design in the photoshop, yes I have done here. I have used
Print the following format
Print the following format  how to print the following format given string "00401121" in java 0-** 1-* 2-* 3- 4
Clear the print button after onclicking the print - Ajax
Clear the print button after onclicking the print  var disp_setting...=yes,width=700, height=330,left=300,top=325"; var rate_print=window.open..., this is my script using for creating table. see print button onclick function
How to print this in java?
How to print pattern in Java?  How to print a particular pattern in Java...;  How to print this in java
print variable in iphone
print variable in iphone  how can i print a variable in iphone????   hello,, if you want to print a variable in objective C if integer then int i=3; NSLog(@"%d",i); if string then NSSting *str; NSLog(@"%@",str
noise during print screen
noise during print screen  hi there, i have a java program which can print screen every 1 seconds... but during the print screen, the image seems will have some noise and ends up half page of the image will be black screen
how to print the server time
how to print the server time  i want to print database time in clintside and update time in every secound without creating connection to database for each time. how can i do
print word with max vowels
print word with max vowels  if suppose i hava entered a sentence and in that sentence i have to print a word which has maximum vowels in it.... i have tried it but i am not getting it...please help
Advertisements
 

 

 

DMCA.com