click on this link......

LinkGrand.com

Tuesday 22 January 2013

To find number of characters in a string

#include<stdio.h>
#include<conio.h>
void main()
{
    char str[25];
    int i=0;
    clrscr();
    printf("Enter the string:");
    gets(str);
    while(str[i]!='\0')
    {
        i++;
    }
    printf("Number of character in %s is %d",str,i);


    getch();
}

To find number of characters in a string
To find number of characters in a string

To find number of characters in a string
To find number of characters in a string


No comments:

Post a Comment