0% found this document useful (0 votes)
9 views22 pages

Save 13

The document contains Java programs for string manipulation using character arrays, matrix multiplication, and operations using the StringBuffer class. Each program includes a menu-driven interface that allows users to perform various operations such as finding string length, concatenating strings, and reversing strings. The programs demonstrate fundamental programming concepts and user interaction through console input and output.

Uploaded by

gaydhsb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views22 pages

Save 13

The document contains Java programs for string manipulation using character arrays, matrix multiplication, and operations using the StringBuffer class. Each program includes a menu-driven interface that allows users to perform various operations such as finding string length, concatenating strings, and reversing strings. The programs demonstrate fundamental programming concepts and user interaction through console input and output.

Uploaded by

gaydhsb
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 22

String Manipulation using Character Array

import java.util.Scanner;
import java.util.Arrays;

public class CharacterArray


{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);
int choice;

do {
displayMenu();
System.out.print("\t\tEnter your choice: ");
choice = scanner.nextInt();
scanner.nextLine(); // Consume newline

switch (choice)
{
case 1:
getStringLength(scanner);
break;
case 2:
findCharPosition(scanner);
break;
case 3:
concatenateStrings(scanner);
break;
case 4:
removeSpaces(scanner);
break;
case 5:
reverseCharArray(scanner);
break;
case 6:
isStringEmpty(scanner);
break;
case 7:
System.out.println("\n\t\tExiting program.");
break;
default:
System.out.println("\n\t\tInvalid choice. Please try again.");
24AI104
Hariharan.R
}
System.out.println(); // Empty line for readability
} while (choice != 7);

scanner.close();
}

public static void displayMenu()


{
String title = "\n\t\tString Manipulation Using Character Array";
String stars = "*".repeat(title.trim().length());

System.out.println(title);
System.out.println("\t\t" + stars);
System.out.println("\t\t1. String Length");
System.out.println("\t\t2. Find Character at Position");
System.out.println("\t\t3. Concatenate Two Strings");
System.out.println("\t\t4. Remove Spaces");
System.out.println("\t\t5. Reverse Character Array");
System.out.println("\t\t6. Check if String is Empty");
System.out.println("\t\t7. Exit\n");
}

public static void getStringLength(Scanner scanner)


{
System.out.print("\t\tEnter a string: ");
String inputString = scanner.nextLine();
char[] charArray = inputString.toCharArray();
int length = 0;

for (char c : charArray) {


length++;
}

System.out.println("\t\tLength of the string: " + length);


}

public static void findCharPosition(Scanner scanner)


{
System.out.print("\t\tEnter a string: ");
String inputString = scanner.nextLine();
char[] charArray = inputString.toCharArray();

24AI104
Hariharan.R
System.out.print("\t\tEnter the position (1-indexed) to find character: ");
int position = scanner.nextInt();
scanner.nextLine(); // Consume newline

if (position >= 1 && position <= charArray.length)


{
char character = charArray[position - 1];
System.out.println("\t\tCharacter at position " + position + ": " + character);
}
else
{
System.out.println("\t\tInvalid position. Please enter a position between 1 and " +
charArray.length);
}
}

public static void concatenateStrings(Scanner scanner)


{
System.out.print("\t\tEnter the first string: ");
String str1 = scanner.nextLine();
System.out.print("\t\tEnter the second string: ");
String str2 = scanner.nextLine();

char[] charArray1 = str1.toCharArray();


char[] charArray2 = str2.toCharArray();
char[] combinedArray = new char[charArray1.length + charArray2.length];

System.arraycopy(charArray1, 0, combinedArray, 0, charArray1.length);


System.arraycopy(charArray2, 0, combinedArray, charArray1.length,
charArray2.length);

String concatenatedString = new String(combinedArray);


System.out.println("\t\tConcatenated String: " + concatenatedString);
}

public static void removeSpaces(Scanner scanner)


{
System.out.print("\t\tEnter a string with spaces: ");
String inputString = scanner.nextLine();
char[] charArray = inputString.toCharArray();
StringBuilder stringBuilder = new StringBuilder();

for (char c : charArray)


24AI104
Hariharan.R
{
if (c != ' ')
{
stringBuilder.append(c);
}
}

String stringWithoutSpaces = stringBuilder.toString();


System.out.println("\t\tString after removing spaces: " + stringWithoutSpaces);
}

public static void reverseCharArray(Scanner scanner)


{
System.out.print("\t\tEnter a string to reverse its character array: ");
String inputString = scanner.nextLine();
char[] charArray = inputString.toCharArray();
int left = 0;
int right = charArray.length - 1;

while (left < right)


{
char temp = charArray[left];
charArray[left] = charArray[right];
charArray[right] = temp;
left++;
right--;
}

System.out.println("\t\tReversed character array: " + Arrays.toString(charArray));


System.out.println("\t\tReversed String (from char array): " + new String(charArray));
}

public static void isStringEmpty(Scanner scanner)


{
System.out.print("\t\tEnter a string: ");
String inputString = scanner.nextLine();
char[] charArray = inputString.toCharArray();

if (charArray.length == 0)
{
System.out.println("\t\tThe string is empty.");
}
else
24AI104
Hariharan.R
{
System.out.println("\t\tThe string is not empty.");
}
}
}
Output:
String Manipulation Using Character Array
***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 1


Enter a string: Hello world
Length of the string: 11

String Manipulation Using Character Array


***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 2


Enter a string: Hello world
Enter the position (1-indexed) to find character: 1
Character at position 1: H

String Manipulation Using Character Array


***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 3

24AI104
Hariharan.R
Enter the first string: H E Y H I
Enter the second string: hello
Concatenated String: H E Y H I hello

String Manipulation Using Character Array


***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 4


Enter a string with spaces: H E Y H I H E L L O
String after removing spaces: HEYHIHELLO

String Manipulation Using Character Array


***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 5


Enter a string to reverse its character array: Hello bro!
Reversed character array: [!, o, r, b, , o, l, l, e, H]
Reversed String (from char array): !orb olleH

String Manipulation Using Character Array


***********************************
1. String Length
2. Find Character at Position
3. Concatenate Two Strings
4. Remove Spaces
5. Reverse Character Array
6. Check if String is Empty
7. Exit

Enter your choice: 7

Exiting program.

24AI104
Hariharan.R
Matrix Multiplication
import java.util.Scanner;

public class MatrixMultiplication


{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);

// Title with a star underline


String title = "Matrix multiplication";
System.out.println("\n\t\t" + title);
System.out.println("\t\t" + "*".repeat(title.length()) + "\n");

// Input dimensions of the first matrix


System.out.print("\t\tEnter the number of rows for the first matrix: ");
int firstMatrixRows = scanner.nextInt();
System.out.print("\t\tEnter the number of columns for the first matrix: ");
int firstMatrixCols = scanner.nextInt();

// Input dimensions of the second matrix


System.out.print("\t\tEnter the number of rows for the second matrix: ");
int secondMatrixRows = scanner.nextInt();
System.out.print("\t\tEnter the number of columns for the second matrix: ");
int secondMatrixCols = scanner.nextInt();

// Check if multiplication is possible


if (firstMatrixCols != secondMatrixRows)
{
System.out.println("\n\t\tMatrix multiplication is not possible.");
System.out.println("\t\tThe number of columns in the first matrix must equal the
number of rows in the second matrix.\n");
return;
}

// Initialize matrices
int[][] firstMatrix = new int[firstMatrixRows][firstMatrixCols];
int[][] secondMatrix = new int[secondMatrixRows][secondMatrixCols];

// Input elements of the first matrix


System.out.println("\n\t\tEnter the elements of the first matrix row by row:");
for (int row = 0; row < firstMatrixRows; row++)
{
System.out.print("\t\tEnter " + firstMatrixCols + " elements for row " + (row + 1) + ":
");
for (int col = 0; col < firstMatrixCols; col++)
{
firstMatrix[row][col] = scanner.nextInt();
}
24AI104
Hariharan.R
}

// Input elements of the second matrix


System.out.println("\n\t\tEnter the elements of the second matrix row by row:");
for (int row = 0; row < secondMatrixRows; row++)
{
System.out.print("\t\tEnter " + secondMatrixCols + " elements for row " + (row + 1) +
": ");
for (int col = 0; col < secondMatrixCols; col++)
{
secondMatrix[row][col] = scanner.nextInt();
}
}

// Perform matrix multiplication


int[][] resultMatrix = new int[firstMatrixRows][secondMatrixCols]; // Resultant matrix
dimensions

for (int row = 0; row < firstMatrixRows; row++)


{
for (int col = 0; col < secondMatrixCols; col++)
{
resultMatrix[row][col] = 0; // Initialize result cell
for (int index = 0; index < firstMatrixCols; index++)
{
resultMatrix[row][col] += firstMatrix[row][index] * secondMatrix[index][col];
}
}
}

// Display the resultant matrix


System.out.println("\n\t\tResultant matrix after multiplication:");
for (int row = 0; row < firstMatrixRows; row++)
{
System.out.print("\t\t");
for (int col = 0; col < secondMatrixCols; col++)
{
System.out.print(resultMatrix[row][col] + "\t");
}
System.out.println();
}

System.out.println();
scanner.close();
}
}

24AI104
Hariharan.R
Output:

Matrix multiplication
*********************

Enter the number of rows for the first matrix: 2


Enter the number of columns for the first matrix: 3
Enter the number of rows for the second matrix: 3
Enter the number of columns for the second matrix: 2

Enter the elements of the first matrix row by row:


Enter 3 elements for row 1: 23 33 44
Enter 3 elements for row 2: 33 22 22

Enter the elements of the second matrix row by row:


Enter 2 elements for row 1: 4 2
Enter 2 elements for row 2: 3 2
Enter 2 elements for row 3: 2 4

Resultant matrix after multiplication:


279 288
242 198

24AI104
Hariharan.R
Performing string operations using Stringbuffer class
import java.util.Scanner;

public class StringBufferClass


{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);

String title = "STRINGBUFFER OPERATIONS";


System.out.println("\n\t\t" + title);
System.out.println("\t\t" + "*".repeat(title.length()) + "\n");

while (true)
{
// Display menu
System.out.println("\t\tChoose an option:");
System.out.println("\t\t1. Find string length");
System.out.println("\t\t2. Reverse string");
System.out.println("\t\t3. Delete part of string");
System.out.println("\t\t4. Add to string");
System.out.println("\t\t5. Insert into string");
System.out.println("\t\t6. Replace part of string");
System.out.println("\t\t7. Exit");

System.out.print("\t\tYour choice: ");


int choice = scanner.nextInt();
scanner.nextLine(); // Clear newline

if (choice == 7)
{
System.out.println("\n\t\tGoodbye!\n");
break;
}

switch (choice)
{
case 1:
findLength(scanner);
break;
case 2:
reverseString(scanner);
break;
case 3:
deletePart(scanner);
break;
case 4:
addString(scanner);
break;
24AI104
Hariharan.R
case 5:
insertString(scanner);
break;
case 6:
replacePart(scanner);
break;
default:
System.out.println("\n\t\tWrong choice, try again.\n");
}
}
scanner.close();
}

// Method to find string length


public static void findLength(Scanner scanner)
{
System.out.print("\t\tEnter a string: ");
String s = scanner.nextLine();
StringBuffer sb = new StringBuffer(s);
System.out.println("\t\tLength: " + sb.length() + "\n");
}

// Method to reverse string


public static void reverseString(Scanner scanner)
{
System.out.print("\t\tEnter a string: ");
String s = scanner.nextLine();
StringBuffer sb = new StringBuffer(s);
sb.reverse();
System.out.println("\t\tReversed: " + sb + "\n");
}

// Method to delete part of string


public static void deletePart(Scanner scanner)
{
System.out.print("\t\tEnter a string: ");
String s = scanner.nextLine();
System.out.print("\t\tStart position (1-based): ");
int start = scanner.nextInt() - 1; // Adjust to 0-based
System.out.print("\t\tNumber of characters to delete: ");
int count = scanner.nextInt();
scanner.nextLine(); // Clear newline
StringBuffer sb = new StringBuffer(s);
sb.delete(start, start + count);
System.out.println("\t\tAfter delete: " + sb + "\n");
}

// Method to append string


public static void addString(Scanner scanner)
{
24AI104
Hariharan.R
System.out.print("\t\tEnter first string: ");
String s = scanner.nextLine();
System.out.print("\t\tEnter string to add: ");
String add = scanner.nextLine();
StringBuffer sb = new StringBuffer(s);
sb.append(add);
System.out.println("\t\tAfter adding: " + sb + "\n");
}

// Method to insert string


public static void insertString(Scanner scanner)
{
System.out.print("\t\tEnter a string: ");
String s = scanner.nextLine();
System.out.print("\t\tEnter string to insert: ");
String insert = scanner.nextLine();
System.out.print("\t\tInsert position (1-based): ");
int pos = scanner.nextInt() - 1; // Adjust to 0-based
scanner.nextLine(); // Clear newline
StringBuffer sb = new StringBuffer(s);
sb.insert(pos, insert);
System.out.println("\t\tAfter insert: " + sb + "\n");
}

// Method to replace part of string


public static void replacePart(Scanner scanner)
{
System.out.print("\t\tEnter a string: ");
String s = scanner.nextLine();
System.out.print("\t\tStart position (1-based): ");
int start = scanner.nextInt() - 1; // Adjust to 0-based
System.out.print("\t\tEnd position (1-based): ");
int end = scanner.nextInt(); // No need to adjust here
scanner.nextLine(); // Clear newline
System.out.print("\t\tEnter replacement: ");
String replace = scanner.nextLine();
StringBuffer sb = new StringBuffer(s);
sb.replace(start, end, replace);
System.out.println("\t\tAfter replace: " + sb + "\n");
}
}

24AI104
Hariharan.R
Output:
STRINGBUFFER OPERATIONS
***********************

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 1
Enter a string: Hello world
Length: 11

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 2
Enter a string: Artificial intelligence
Reversed: ecnegilletni laicifitrA

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 3
Enter a string: Hello world
Start position (1-based): 2
Number of characters to delete: 4
After delete: H world

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string

24AI104
Hariharan.R
6. Replace part of string
7. Exit
Your choice: 4
Enter first string: hello world
Enter string to add: python
After adding: hello worldpython

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 5
Enter a string: Hello World
Enter string to insert: Hi
Insert position (1-based): 8
After insert: Hello WHiorld

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 6
Enter a string: Hello world
Start position (1-based): 2
End position (1-based): 6
Enter replacement: K
After replace: HKworld

Choose an option:
1. Find string length
2. Reverse string
3. Delete part of string
4. Add to string
5. Insert into string
6. Replace part of string
7. Exit
Your choice: 7

Goodbye!

24AI104
Hariharan.R
Performing string operations using String class
import java.util.Scanner;
import java.util.Arrays;

public class StringClass


{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);

String title = "STRING OPERATIONS";


System.out.println("\n\t\t" + title);
System.out.println("\t\t" + "*".repeat(title.length()) + "\n");

while (true)
{
// Display menu
System.out.println("\t\tChoose an option:");
System.out.println("\t\t1. Join strings");
System.out.println("\t\t2. Find substring");
System.out.println("\t\t3. Get substring");
System.out.println("\t\t4. Change character");
System.out.println("\t\t5. String to char array");
System.out.println("\t\t6. Compare strings (ignore case)");
System.out.println("\t\t7. Exit");

System.out.print("\t\tYour choice: ");


int choice = scanner.nextInt();
scanner.nextLine(); // Clear newline

if (choice == 7)
{
System.out.println("\n\t\tGoodbye!\n");
break;
}

switch (choice)
{
case 1:
joinStrings(scanner);
break;
case 2:
findSubstring(scanner);
break;
case 3:
getSubstring(scanner);
break;
case 4:
24AI104
Hariharan.R
changeChar(scanner);
break;
case 5:
toCharArray(scanner);
break;
case 6:
compareIgnoreCase(scanner);
break;
default:
System.out.println("\n\t\tWrong choice, try again.\n");
}
}
scanner.close();
}

// Method to concatenate strings using concat()


public static void joinStrings(Scanner scanner)
{
System.out.print("\t\tEnter first string: ");
String s1 = scanner.nextLine();
System.out.print("\t\tEnter second string: ");
String s2 = scanner.nextLine();
String result = s1.concat(s2);
System.out.println("\t\tJoined: " + result + "\n");
}

// Method to search for substring using contains()


public static void findSubstring(Scanner scanner)
{
System.out.print("\t\tEnter main string: ");
String main = scanner.nextLine();
System.out.print("\t\tEnter substring to find: ");
String sub = scanner.nextLine();
if (main.contains(sub))
{
System.out.println("\t\tFound it!\n");
}
else
{
System.out.println("\t\tNot found.\n");
}
}

// Method to extract substring using substring()


public static void getSubstring(Scanner scanner)
{
System.out.print("\t\tEnter string: ");
String s = scanner.nextLine();
System.out.print("\t\tStart position (1-based): ");
int start = scanner.nextInt() - 1;
24AI104
Hariharan.R
System.out.print("\t\tEnd position (1-based): ");
int end = scanner.nextInt();
scanner.nextLine(); // Clear newline
String result = s.substring(start, end);
System.out.println("\t\tSubstring: " + result + "\n");
}

// Method to replace character using replace()


public static void changeChar(Scanner scanner)
{
System.out.print("\t\tEnter string: ");
String s = scanner.nextLine();
System.out.print("\t\tOld character: ");
char old = scanner.next().charAt(0);
System.out.print("\t\tNew character: ");
char newChar = scanner.next().charAt(0);
scanner.nextLine(); // Clear newline
String result = s.replace(old, newChar);
System.out.println("\t\tChanged: " + result + "\n");
}

// Method to convert string to char array using toCharArray()


public static void toCharArray(Scanner scanner)
{
System.out.print("\t\tEnter string: ");
String s = scanner.nextLine();
char[] chars = s.toCharArray();
System.out.println("\t\tChar array: " + Arrays.toString(chars) + "\n");
}

// Method to compare strings case-insensitively using equalsIgnoreCase()


public static void compareIgnoreCase(Scanner scanner)
{
System.out.print("\t\tEnter first string: ");
String s1 = scanner.nextLine();
System.out.print("\t\tEnter second string: ");
String s2 = scanner.nextLine();
if (s1.equalsIgnoreCase(s2))
{
System.out.println("\t\tSame (ignoring case).\n");
}
else
{
System.out.println("\t\tDifferent (ignoring case).\n");
}
}
}

24AI104
Hariharan.R
Output:
STRING OPERATIONS
*****************

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 1
Enter first string: Hello
Enter second string: World
Joined: HelloWorld

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 2
Enter main string: Hello
Enter substring to find: ell
Found it!

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 3
Enter string: Hello world
Start position (1-based): 2
End position (1-based): 6
Substring: ello

Choose an option:
1. Join strings
2. Find substring
3. Get substring

24AI104
Hariharan.R
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 4
Enter string: Hello World
Old character: l
New character: N
Changed: HeNNo WorNd

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 5
Enter string: Hello World
Char array: [H, e, l, l, o, , W, o, r, l, d]

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 6
Enter first string: Hi how are you
Enter second string: HI HOW ARE YOU
Same (ignoring case).

Choose an option:
1. Join strings
2. Find substring
3. Get substring
4. Change character
5. String to char array
6. Compare strings (ignore case)
7. Exit
Your choice: 7

Goodbye!

24AI104
Hariharan.R
Text Analyzer
import java.util.Scanner;

public class TextAnalyzer


{
public static void main(String[] args)
{
Scanner scanner = new Scanner(System.in);

System.out.println("\n\t\tWELCOME TO TEXT ANALYZER");


System.out.println("\t\t************************");
System.out.println("\t\tEnter text (press Enter twice to finish):\n");

StringBuilder text = new StringBuilder();


while (true)
{
String line = scanner.nextLine();
if (line.isEmpty())
break;
text.append(line).append("\n");
}

if (text.length() == 0)
{
System.out.println("\t\tNo text entered.");
scanner.close();
return;
}

String str = text.toString();


int chars = str.length();
int lines = str.split("\n").length;
int words = str.trim().isEmpty() ? 0 : str.split("\\s+").length;
String lower = str.toLowerCase();
int vowels = lower.replaceAll("[^aeiou]", "").length();
int consonants = lower.replaceAll("[^a-z]", "").length() - vowels;
int numbers = lower.replaceAll("[^0-9]", "").length();
int spaces = str.replaceAll("[^ ]", "").length();
int newlines = lines - 1;
int special = chars - (vowels + consonants + numbers + spaces + newlines);

System.out.println("\n\t\tANALYSIS RESULTS");
System.out.println("\t\t****************");
System.out.println("\t\tCharacters:\t\t" + chars);
System.out.println("\t\tLines:\t\t\t" + lines);
System.out.println("\t\tWords:\t\t\t" + words);
System.out.println("\t\tVowels:\t\t\t" + vowels);
System.out.println("\t\tConsonants:\t\t" + consonants);

24AI104
Hariharan.R
System.out.println("\t\tNumbers:\t\t" + numbers);
System.out.println("\t\tSpaces:\t\t\t" + spaces);
System.out.println("\t\tNewlines:\t\t" + newlines);
System.out.println("\t\tSpecial Characters:\t" + special);

scanner.close();
}
}

Output:

WELCOME TO TEXT ANALYZER


******************************
Enter text (press Enter twice to finish):

Hi How are you ! Iam fine How about you ?? Can you Drop me at 2:00 P.M at Google Office
@Day.

ANALYSIS RESULTS
*******************

Characters: 94
Lines: 1
Words: 22
Vowels: 30
Consonants: 32
Numbers: 3
Spaces: 21
Newlines: 0
Special Characters: 8

WELCOME TO TEXT ANALYZER


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

Enter text (press Enter twice to finish):

Hey Iam Studying Artificial intelligence and Data Science at Anna UNiversity.
And be proud to myself.
My number is 425267671.
email is hhari@#$.com
Bye!!........

24AI104
Hariharan.R
ANALYSIS RESULTS
*******************
Characters: 164
Lines: 5
Words: 24
Vowels: 45
Consonants: 67
Numbers: 9
Spaces: 21
Newlines: 4
Special Characters: 18

24AI104
Hariharan.R

You might also like