728x90 AdSpace

Latest Article



C C++ PROGRAM TO IMPLEMENT SENTENCS CASE





A PROGRAM TO IMPLEMENT SENTENCS  CASE Array String


#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
# define INDEX 80                      /*      MAX ARRAY LENGTH=80       */
void main(void)
{
char string[INDEX];
int length,i;
clrscr();
puts("ENTER THE STRING\n");
gets(string);
length=strlen(string);              /*     CHECKING MAX STRING LENGTH    */
string[0]=toupper(string[0]);
for(i=1;i<=length;i++)
 {
  string[i]=tolower(string[i]);     /* CONVERT ENTIRE STRING TO LOW CASE */
 }
 for(i=1;i<=length;i++)
  {
   if(string[i]=='.')
   string[i+1]=toupper(string[i+1]);  /* UPPER CASE CONVERSION AFTER '.' */
  }
puts(string);
printf("THE LENGTH OF THE STRING WAS %d",length);
getch();
}

no image
  • Title : C C++ PROGRAM TO IMPLEMENT SENTENCS CASE
  • Posted by :
  • Date : 04:10
  • Labels :






  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment