#include<stdio.h>
main()
{
     while(!printf("Hello World Without Using Semicolon"))
     {
     }
     if(printf(getch()))
     {
     }
}


In C/C++ a semicolon is used to terminate the statement.But if,while,switch(conditional constructs) do not require a semicolon to terminate.So if we use the printf statement inside these conditional constructs,then we do not require any semicolon to terminate the statement.



import java.util.*;

class countWords
{
    public static void main(String s[])
    {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        char ch;
       
        System.out.println("Enter The String To Count No. Of Words :  ");
        String str = sc.nextLine();
       
        for(int i=0;i<str.length();i++)
        {
                ch = str.charAt(i);
                if(ch ==' ')
                {
                    count++;
                }               
        }
        System.out.println("The no of words in given string is : " + (count+1));
    }
}
import java.util.*;

class countSpaces
{
    public static void main(String s[])
    {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        char ch;
       
        System.out.println("Enter The String To Count No. Of Spaces :  ");
        String str = sc.nextLine();
       
        for(int i=0;i<str.length();i++)
        {
                ch = str.charAt(i);
                if(ch ==' ')
                {
                    count++;
                }
        }
        System.out.println("The no of Spaces in given string is : " + count);
    }
}
import java.util.*;

class countConsonants
{
    public static void main(String s[])
    {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        char ch;
       
        System.out.println("Enter The String To Count No. Of Consonants :  ");
        String str = sc.nextLine();
       
        for(int i=0;i<str.length();i++)
        {
                ch = str.charAt(i);
                count++;
                if((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') || (ch == 'u') || (ch ==' '))
                {
                    count--;
                }
        }
        System.out.println("The no of Consonants in given string is : " + count);
    }
}
import java.util.*;

class countVowel
{
    public static void main(String s[])
    {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        char ch;
       
        System.out.println("Enter The String To Count No. Of Vowels :  ");
        String str = sc.nextLine();
       
        for(int i=0;i<str.length();i++)
        {
                ch = str.charAt(i);
                if((ch == 'a') || (ch == 'e') || (ch == 'i') || (ch == 'o') || (ch == 'u'))
                {
                    count++;
                }
        }
        System.out.println("The no of vowels in given string is : " + count);
    }
}