I'm trying to make a program that reads a sentence, and then put each word initial in capital letters, if not already. The problem is that I type a sentence but it only returns the first word, nothing more. the word is with the first capital letter but the other words of the phrase do not appear in output .
#include<stdio.h>
#include<ctype.h>
char namechange( char abc[], int size);
int main()
{
int i,n;
char name[100000];
scanf("%s", &name);
namechange( name, n );
}
char namechange( char abc[], int size)
{
int i, k = 0;
for ( i = 0; abc[i] != '#include<stdio.h>
#include<ctype.h>
char namechange( char abc[], int size);
int main()
{
int i,n;
char name[100000];
scanf("%s", &name);
namechange( name, n );
}
char namechange( char abc[], int size)
{
int i, k = 0;
for ( i = 0; abc[i] != '%pre%'; i ++)
{
int a,b;
a = abc[i];
b = abc[i - 1];
if (i == 0 || 'b' == 8)
abc[i] = toupper (abc[i]);
}
while ( abc[k] != '%pre%')
{
printf("%c", abc[k]);
k = k + 1;
}
}
'; i ++)
{
int a,b;
a = abc[i];
b = abc[i - 1];
if (i == 0 || 'b' == 8)
abc[i] = toupper (abc[i]);
}
while ( abc[k] != '%pre%')
{
printf("%c", abc[k]);
k = k + 1;
}
}