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
Define the Self-Referential Structures? It is occasionally desirable to include within a structure one member that is a pointer to the parent structure type. Generally in terms

Write a program that performs character processing on 10 characters read in from a file, and writes the results to output files. Do NOT use loops or arrays to solve this problem. N

program for singly linked list with out header

What is memory allocation? Memory Allocation : It is the method of allocating memory storage to program in such that the program can be run.

Dynamic Initialization of objects: It is initializing the objects by passing the valued to the constructor from the user input or other means.   Through cin operator a value

Q: Name the operators which cannot be overloaded? A:sizeof, ., .*, .->, ::, ?:

You are given a collection of words, say as in a dictionary. You can represent it in the following compressed form: the first word will be followed by a sequence of a pair of numbe

can you help with the assignment, I don''t want to upload the assignment but want somebody to work with, do you do that?

Program is to display the contents of file on a screen: Write a program to display the contents of file on a screen void main()   {  clrscr();  ifstream fin("ascii

A small shop sells 280 different items. Every item is identified by a 3 - digit code. All items which start with a zero (0) are cards, all items which start with a one (1) are swee