Skip to content

Instantly share code, notes, and snippets.

@zaman
Created December 2, 2010 19:17
Show Gist options
  • Save zaman/725878 to your computer and use it in GitHub Desktop.
Save zaman/725878 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main()
{
char *s,*p;
int i;
s="merhaba dunya";
p=malloc(strlen(s));
p[0] = toupper(s[0]);
for (i = 1; i < strlen(s); i++) {
if (s[i-1] == ' ' || s[i+1]=='\0')
p[i] = toupper(s[i]);
else
p[i] = s[i];
}
printf("%s",p);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment