Sunday, 11 December 2011

Write a program to print a String and find out of its total Character in c

#include
#include
main()
{
char a[20];
int j;
clrscr();
printf("Enter a string:");
gets(a);
for(j=0;a[j]!='\0';j++);
{
printf("\nTotal char=%d",j);
}
getch();
}

OUTPUT
Enter a string: TEJKUMAR SAHARAN
Total char = 15

No comments:

Post a Comment