#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
main()
{
clrscr();
char str[80];
cout<<"Enter any string"<<endl;
gets(str);
for(int i=0;str[i]!=NULL;i++)
{
if(str[i]==' ')
{
str[0]=toupper(str[0]);
str[i+1]=toupper(str[i+1]) ;
i++;
}
}
cout<<endl<<endl;
puts(str);
getch();
}
#include<conio.h>
#include<stdio.h>
#include<ctype.h>
#include<string.h>
main()
{
clrscr();
char str[80];
cout<<"Enter any string"<<endl;
gets(str);
for(int i=0;str[i]!=NULL;i++)
{
if(str[i]==' ')
{
str[0]=toupper(str[0]);
str[i+1]=toupper(str[i+1]) ;
i++;
}
}
cout<<endl<<endl;
puts(str);
getch();
}
No comments:
Post a Comment