Just to bring my post count to 45. This counts the characters in a user entered string.
#include <stdio.h>
#include <strings.h>
int main()
{
char word[1000];
int i=0;
printf("Enter text: ");
gets(word);
while(word[i]!='\0')
{
i++;
}
printf("Text is %i character/s long.",i);
return 0;
}
#include <stdio.h>
#include <strings.h>
int main()
{
char word[1000];
int i=0;
printf("Enter text: ");
gets(word);
while(word[i]!='\0')
{
i++;
}
printf("Text is %i character/s long.",i);
return 0;
}
No comments:
Post a Comment