Thread: TOUPPER functions?

  1. #1
    Registered User
    Join Date
    Dec 2010
    Posts
    7

    TOUPPER functions?

    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);
    
    }

  2. #2
    Registered User
    Join Date
    May 2010
    Location
    Naypyidaw
    Posts
    1,314
    Not even close. You need loop.

  3. #3
    Registered User
    Join Date
    Dec 2010
    Posts
    7
    where I start loop?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Array of functions
    By frktons in forum C Programming
    Replies: 29
    Last Post: 06-30-2010, 09:51 AM
  2. Need help with functions
    By jusfry01 in forum C Programming
    Replies: 2
    Last Post: 05-22-2010, 06:25 PM
  3. Void Functions Help
    By bethanne41 in forum C++ Programming
    Replies: 1
    Last Post: 05-09-2005, 05:30 PM
  4. Functions and Classes - What did I do wrong?
    By redmage in forum C++ Programming
    Replies: 5
    Last Post: 04-11-2005, 11:50 AM
  5. calling functions within functions
    By edd1986 in forum C Programming
    Replies: 3
    Last Post: 03-29-2005, 03:35 AM