Wednesday, October 31, 2018

STRING: PROGRAM TO COUNT NUMBER CHARACTER IN A STRING

#include<stdio.h>
void main()
{
char str[20];
int i,count=0;
printf("Enter the string:");
gets(str);
for(i=0;str[i]!='\0';i++)
{
count++;
}
printf("the number of character: %d",count);
}

No comments:

Post a Comment

Static Member Function

CODE : #include<iostream> using namespace std; class test  {     int code;       static int count;               //static...