Java Program to Count Letters in a String1 min read

In this tutorial to Count Letters in a String in java, we will see two examples to count the number of letters present in a String in Java.

  • The first one, where the String is already defined in a program.
  • The second one, where the String is taken as input from the user

Both the program uses for loop and if statement to count the letters so if you do not know about them, click the link below.


1. Java Program to Count the Letters in a String.

Output:


2.┬áJava Program to Count the Letters in a String (user’s input)

Output:


MORE

C Program to Check whether the entered character is capital, small letter, digit or special character

In this tutorial, we will write a program to check whether the entered character is capital, small letter, digit or any special character using C …
Read More

C Program to Check Armstrong Number

In this C programming example, we will write a program to check Armstrong Number in C. We will start with Armstrong Number. Before that, you …
Read More

C Program to Generate Random numbers within a Range

In this tutorial, you will learn to generate random numbers within a range in C programming. But before that, you may go through the topic …
Read More

C Program to Generate Random Numbers

In this C program section, we will learn how to generate random numbers in C programming. Let us start with random numbers. What is Randon …
Read More

Keith Number in Java

In this java programming tutorial, you will learn about Keith Number and its implementation in java. It is frequently asked in Java coding. What is …
Read More

Fascinating Number in Java

In this java program tutorial, we will learn about the Fascinating Number and its implementation through Java. We will check whether the number Fascinating Number …
Read More