PROGRAM:
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
void main() {
clrscr();
int len;
char ch[200];
cout<<"Program to count number of characters entered by the user: \n";
cout<<"Enter your sentence: \n";
gets(ch);
len=strlen(ch);
cout<<"\ntotal number of characters: "<<len;
getch();
}
No comments:
Post a Comment