Sunday 8 September 2013

c++ program to convert given sentence in uppercase to lowercase alphabets

#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
       char caps[50],c;
      int z;
       clrscr();
      cout<<"enter a sentence in uppercase..";
      cin.get(caps,50);
      l=strlen(caps);
      cout<<"your string length is.."<<l<<"\n";
      for(int i=0;i<l;i++)
      {
        z=caps[i];
        z=z+32;
        c=z;
        cout<<c;
      }
      getch();
}


sample input and output:enter a sentence in uppercase..
input:HELLO.
output:your string length is 5.
hello.

No comments:

Post a Comment