Thank you all for being with us.
Learn, Create and Implement.

  • Build Concept

    You can build your concept in programming on programsway.com.

  • Examples

    There are many C Programming examples on programsway.com.

  • Ask Questions

    Ask questions and get quick answers. Request any program and we will publish that program.

  • Saturday, 9 March 2013

    In C every character has a ASCII number. Here we can use this concept for this program.
    First we take a input from user. Then we check whether it is an alphabet or not and also check whether it is  in capital or in small letter. If it is in capital then we add 32 with the character's ASCII value.
    If it is in small letter then we subtract  32 from the character's ASCII value.
                                              For your convenience here is the ASCII chart.

    Now the the example ....


    #include<stdio.h>
    #include<ctype.h>
    int main()
    {
    char c;
    printf("Enter a  alphabet  ");
    scanf("%c",&c);
            if(isalpha(c))
            {
             if(c<'a')
               {
          c+=32;
          printf("\nYou have entered capital letter\nThe corresponding  small letter is  %c\n",c);
               }
            else
               {
                  c-=32;
                  printf("\nYou have entered small letter\nThe corresponding  capital letter is  %c\n",c);
                }
            }
    return 0;
    }

    The output of this program will be....

    2 comments:

    1. Bravo!!!!This is really amazing and unbelievable.You have done a miracle.Thanks.

      ReplyDelete