Wednesday, 4 November 2015

C++ Program To Convert A Lower Case To Upper Case

Problem :- Write A C++ Program To Convert A Lower Case To Upper Case .

Logic :- This Problem Can Solve using ASCII Value If you Do not know How Check This C++ Program To Check Upper Case Lower Case Digit And Special Symbol . Now you Can Modify or you need to little modification .

String =String-32

Solution :-

#include<iostream>
using namespace std;
void upr(char*);
int main()
{
    //By-Ghanendra Yadav
    char string[25];
    cout<<"\nEnter a string : ";
    cin>>string;
    upr(string);
    cout<<"\n\n"<<string; 
}
void upr(char *string)
{       
    int i=0;
    while(string[i]!='\0')
    {
        string[i]=string[i]-32;
        i++;
    }  
}

Output:-

C++ Program To Convert A Lower Case To Upper Case

No comments:
Write comments

Recommended Posts × +