Capitalize Each Word in C Programming Tamil


#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
	int n,i;
	char a[100];
	clrscr();
	printf("\n Enter the string :");
	gets(a);
	n=strlen(a);
	printf("\n Length of the string :%d\n",n);
	if(a[0]>=65&&a[0]<=90)
	{
		printf("%c",a[0]);
	}
	if(a[0]>=97&&a[0]<=122)
	{
		printf("%c",a[0]-32);
	}
	for(i=1;i<n;i++)
	{
		if(a[i]==32)
		{
			printf(" ");
			i++;
			if(a[i]>=65&&a[i]<=90)
			{
				printf("%c",a[i]);
			}
			else
			{
				printf("%c",a[i]-32);
			}
		}
		else
		{
			printf("%c",a[i]);
		}
	}
	getch();
}

Login To Download Source Code

Leave a Comment:

Login To Comment

List Of Programs


Goto Examples

Operators

Looping

Number Conversion

Pattern Design

Arrays

Matrix Examples

Sorting Examples

String Function

Change Case

String In C

Maths Functions

User Defined Functions

Recursive Functions

Pointer

Structure

File Concept

Calender Programming