C++ Program to Count Number of Characters in Text

Write a c++ program to count the total number of characters in a given text. By using this program we can find the number of letters in the letter or character entered by the user in output. It will help for the note writers and some other educanist.

#include <iostream>
using namespace std;
int main()
char str[100];
int i,value;
cout<<"Enter the letter or characters\n";
cin>> str;
for(i=0; str[i] != '\0'; i++)
if(str[i]!=' ')
cout<<"The total characters are present in the program "<<value;
return 0;



Enter the letter or characters
The total characters are present in the program 10

What is post increment in c++ program

Post-increment operator: A post-increment operator is used to increase the value of a variable after the expression has been fully executed. Value is first utilized in an expression and then increased in the Post-Increment.

For loop and how to implement for loop

A loop is used to continually execute a set of statements until a certain condition is met. When showing numbers from 1 to 100, for example, you might wish to set the value of a variable to 1 and display it 100 times, raising its value by 1 with each loop iteration.

Similar Programs