Wednesday, 11 May 2016

JAVA Program for printing the triangle pattern


Input Format:

Enter N: 5

Output Format:

*
* *
* * *
* * * *
* * * * *
* * * *
* * * 
* * 


Program:

import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter N: ");
int height = ( Integer.parseInt( s.nextLine( ) ) );
StringBuffer str = new StringBuffer( );
for(int i = 0;i < height*2; i++){
      if( i > = height )
            str.deleteCharAt( 0 );
      else
            str.append("*");
      System.out.println(str);
}
}
}


Tuesday, 10 May 2016

WhatsApp Messenger for Windows and Mac Desktop


WhatsApp was founded in 2009 by two tech guys Brian Acton and Jan Koum. Earlier they worked in Yahoo company. Later those two geek guys founded WhatsApp. Then WhatsApp acquired by Facebook on February 19, 2014.

Now a days WhatsApp Messenger is the very good popular messaging app which allows you to exchange messeges, contacts, documents, audio files,  photos and locations without having to pay for SMS.

Earlier WhatsApp Messenger is only available for Mobile like iPhone, BlackBerry, Windows Phone, Android and Nokia. Now it is available for Windows and Mac Desktop computers.

The following image shows the Desktop Application for WhatsApp Messenger.



WhatsApp Features

--> Now WhatsApp available as free to everyone in the world!

--> Now WhatsApp provides high security for messages. It provides end-to-end encryption.

The following image shows end-to-end encryption.





WhatsApp Text Features

--> _text_ for Italic text

--> *text* for Bold text

--> *_text_* for Bold and Italic text

--> ~text~ for strike text

--> ```text``` for hidden font style

The following image shows WhatsApp Text features.



for more details visit WhatsApp official Website.



Monday, 9 May 2016

JAVA program for printing the Capital letters in the given sentence


Explanation:

User give an input as a sentence. That contains set of words separated by space. We have to print the Capital letters in the given input sentence.

Input format:

Enter any sentence:
Let Us Code in C Let Us Code in JAVA

Output format:

L U C C L U C J A V A

Program:

import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
System.out.println("Enter any Sentence");
String ss = s.nextLine();
String[ ] a = ss.split(" ");
String res = "";
for(int i = 0;i<a.length;i++)
{
String str = a[i];
for(int j = 0;j<str.length();j++)
{
int ch = str.charAt(j);
if(ch<=90 && ch>=65)
{
res+ = str.charAt(j)+" ";
}
}
}
System.out.println(res);
}
}


Source Code: download

Sunday, 8 May 2016

JAVA program for reversing the words in the given sentence


Explanation:

User give an input as a sentence. That contains set of words separated by space. We have to reverse the each word in the given input sentence.

Input format:

Enter any sentence:
Let Us Code in C Let Us Code in JAVA

Output format:

teL sU edoC ni C teL sU edoC ni AVAJ

Program:

import java.util.Scanner;
public class Test{
           public static void main(String[] args) {
      Scanner s = new Scanner(System.in);
      System.out.println("Enter any Sentence:");
      String ss = s.nextLine( );
      String[ ] a = ss.split(" ");
      String res="";
      for(int i=0;i<a.length;i++){
         StringBuffer s1 = new StringBuffer(a[i]);
         s1.reverse( );
         res+=s1+" ";
      }
      System.out.println(res);
    }
}


Source Code: download