C program for change the case in title case, C/C++ Programming

 

#include stdio.h>

#include conio.h>

#include ctype.h>

#include string.h>

 

void main()

{

          int i=0,j=0,length;

          char a[30];

          clrscr();

          for(i=0;i<30;i++)

          {

                   a[i]=0;

          }

          i=0;

          printf("ENTER THE STRING: ");

          do{

                   a[i++]=getchar();

          }while(a[i-1]!='\n');

          a[i]='\0';

          length=strlen(a);

          for(i=0;i<=length;i++)

          {

                   a[i]=tolower(a[i]);

          }

          i=0;

          a[0]=a[0]-32;

                     for(i=0;a[i]!='\0';i++)

                     {

                             if(a[i]==' ')

                             {

                                      a[i+1]=a[i+1]-32;

                             }

                     }

                   printf("THE OUTPUT OF STRING IS %s",a);

          getch();

}

 

OUTPUT :

ENTER THE STRING: KAMLESH D MENGAR

 THE OUTPUT OF STRING IS Kamlesh D Mengar

Posted Date: 9/10/2012 4:22:38 AM | Location : United States







Related Discussions:- C program for change the case in title case, Assignment Help, Ask Question on C program for change the case in title case, Get Answer, Expert's Help, C program for change the case in title case Discussions

Write discussion on C program for change the case in title case
Your posts are moderated
Related Questions
Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers. Descriptions of this algorithm are available in algebra books

You're going to simulate a metropolitan subway train.  The train system will start out at Station #1, or Home  Station, and will service multiple stations along its route.

write an algorithm for linear search algorithm

i want to check the command line argument is whether an integer or a string

Implement a menu driven real estate catalogue system that allows users to perform various catalogue maintenance and search tasks.  You are only allowed to use the C programming la

#A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrom

Define Types of storage classes in C language? There are four storage classes in C language: 1. Automatic storage class. 2. External storage class. 3. Register storage cla

Program is to append the contents of one file to another: void main()    {   clrscr();   fstream file1,file2;   char st1[13],st2[13];/* 13 because a filename canno

explain about symbolic constants with examples

Write a program to find minimum number of shelves