Jedno z možných (kompletních) řešení:
#include "stdafx.h"
#include <stdio.h>
#include <ctype.h>
int main()
{
char string[100];
int c = 0;
int pocetMezer = 0;
printf("Vlozte svuj text s mezerama (max 99 znaku) \n");
gets(string);
string[0] = toupper(string[0]); // zvetseni prvniho pismena
while ( string[c] != '\0' )
{
if ( string[c] == ' ' )
{
pocetMezer++;
string[(c+1)] = toupper(string[(c+1)]);
}
c++;
}
printf("\nPocet mezer: %d\n Pocet slov: %d \nZadana veta s velkymi pismeny slov: %s", pocetMezer, pocetMezer+1, string);
gets(string); // pauznuti
return 0;
}