#include<stdio.h>
#include<conio.h>
void incap(char s[]);
void main()
{
char ch[20];
clrscr();
puts("Enter any string ");
gets(ch);
incap(ch);
getch();
}
void incap(char s[])
{
int i,j;
for(i=0;s[i]!='\0';i++)
{
if(s[i]==' '&& s[i+1]!=' ')
s[i+1]=s[i+1]-32;
else if(i==0)
s[i]=s[i]-32;
}
puts(s);
}
Subscribe to:
Post Comments (Atom)
Related Post
Array:
String functions:
General (Loops-for/while)
No comments:
Post a Comment