Don't miss

Friday, 16 August 2013

C++ : Change Case Of An Alphabet


By on 9:59:00 pm

The following code is for a C++ Programme to change the case of a given alphabet.

That is :
If "a" is input , the output is "A" [ Small letter to Capital letter]
If "A" is input , the output is "a" [ Capital letter to Small letter]

Program to show change of case of Alphabet









#include<iostream.h>
#include<conio.h>

void main()

{

clrscr();

char a,c;
int b,d;

cout<<"Enter a alphabet\n";
cin>>a;
b=a;

if(b<91)
  {
    d=b+32;
    c=d;
    cout<<c;
  }
else
{
   d=b-32;
   c=d;
   cout<<c;
 }

getch();
}

0 comments:

Post a Comment