Created
December 2, 2010 19:17
-
-
Save zaman/725878 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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