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
how to create program in c that will system restart

create a program to populate the first array then the odd number is the second array and get the sum of the second array.

A parking garage charges a $2.00 minimum fee to park for up to three hours and an additional $0.50 per hour for each hour or part thereof over three hours. The maximum charge for a

write a c++ program to accept 3 numbers and find the largest of 3 numbers

Determine the types of Container class Container class can be of 2 types: - Heterogeneous container - Here container class comprise a group of mixed objects - Homogeneou

hello i have about 15 hours the dead line I Need a program in c language that''s determine the router ip or the gateway ip of the current NIC example the router ip is: 192.168.1.1

: Write a program that prompts the user to enter five digit positive numbers. The program then outputs the digits of the number one digit per line. Eg if the user enters 32456, th

Project Description: Need to develop an expert advisor base on sthocastic oscilator with my own setting.. Very basic touch line OB/OS only but on my setting n condition Skill

C Program for DIVISER   void main() {           int result,number,min;           clrscr();           printf("ENTER THE NUMBER=");           flushall();