hello,
I wrote this program but I face some problems.I tryed to wrote below-mentioned problem. what can I do another steps? thank you...
Write a C program which reads 20 characters and displays the number of occurrences of a lowercase letter immediately followed by its uppercase correspondent. E.g. If the input is “AaAaBbBcdDefgHjKheEm”, your program should display 4 due to the underlined sequences.
Example Run:
Enter 20 characters: gGXxXTtYYaaABBbjJkzZ
The number of occurrences is: 5
Code:
#include<stdio.h>
#include <ctype.h>
int main (void)
{
char ch;
printf("Enter 20 characters:");
scanf(" %c",&ch);
printf("The number of occurances is:%c\n",toupper(ch));
return(0);
}