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
What is the purpose of return values? Can you not return any values from a function? If you could what would he function look like?

What happens while a derived-class object is developed & destroyed? A: Space is allocated (on the heap or the stack) for the full object (i.e. adequate space to store the data m

SquareMaze The SquareMaze class should be declared and defined in maze.h and maze.cpp, respectively. Each SquareMaze object will represent a randomly-generated square maze and its

write a program that counts the number of occurrences of the string in the n-th padovan string p(n)   program 1 : package test.padovanstring; public class PadovanString {

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

IS IT POSSIBLE FOR YOU TO WRITE A PROGRAM FOR ME TO MEASURE EXISTING ANGLES AND DO IF AND THEN FROM THIS , AND TO PLACE FIXED ANGLES AT CERTAIN POSITION AS A ADD WITH DLL FOR CERTA

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation.

accept principal amount,rate of interest, & duration from the user. display interest amount and total amount

Question 1 Explain the concept of constructors and destructors in C++ with programming examples Question 2 Explain the concepts and applications of multiple inheritance and v

Queue - C++ program: Write a program to show the basic operations on queue. namespace stack {  const int max_size = 200;  char v(max_size);  int top=0;  void pu