Example & Tutorial understanding programming in easy ways.

Write a program to titled the given string

program:

#include<stdio.h>

int main()

{

    char s[30],s1[30];

    int i=0;

    printf("Enter the stringn");

    gets(s);

    while(s[i]!=0)

    {

        if(i==0)

        s1[i]=s[i]-32;

        else

        if(s[i-1]==32)

        s1[i]=s[i]-32;

        else

        s1[i]=s[i];

        i++;

    }

    s1[i]='';

    printf("nTitled String is : %s",s1);

}

output:

Enter string

this is my string

Titled string is : This Is My String

Read More →
Search
R4R Team
R4Rin Top Tutorials are Core Java,Hibernate ,Spring,Sturts.The content on R4R.in website is done by expert team not only with the help of books but along with the strong professional knowledge in all context like coding,designing, marketing,etc!