Sunday, 7 April 2013

length of the string in c program

Program to find the length and change the case

 
#include<stdio.h>
#include<string.h>

void main()
{

char a[100];
int length;
clrscr();

printf("Enter a string to calculate it's length\n");
gets(a);
length = strlen(a);
printf("Length of entered string is = %d\n",length);
printf("%s\n",strlwr(a));
printf("%s\n",strupr(a));
getch();

}

No comments:

Post a Comment