Here is the source code of the C program to find the first capital letter in a string using recursion. The C program is successfully compiled and run on a Linux system. The program output is also shown below.
* C Program to find the First Capital Letter in a String without
* using Recursion
char caps_check(char *);
char string, letter;
printf("Enter a string to find it's first capital letter: ");
letter = caps_check(string);
if (letter == 0)
printf("No capital letter is present in %s.\n", string);
printf("The first capital letter in %s is %c.\n", string, letter); }
char caps_check(char *string)
int i = 0;
while (string[i] != '\0')
$ cc pgm35.c $ a.out Enter a string to find it's first capital letter: prOgraMmInG The first capital letter in prOgraMmInG is O.
Sanfoundry Global Education & Learning Series – 1000 C Programs.