You are here:

C++/asdasdasdasd

Advertisement


Question
input:paulo hariramani
output:Paulo Hariramani

using string manipulation

Answer
This is a program to convert lower case to upper case characters. You can apply simple programming technique to get your desired result.


// convert the string to upper case letters
# include <iostream>
using namespace::std;
void makeUpper(char str[])
{   
  char i=0;
  while (str[i]!=0)
  {
     if (str[i]>'a'||str[i]<'z')
     cout<<static_cast<char>(static_cast<int>(str[i])-32);
     i++;
  }
  cout<<endl;
}
int main (void)
{
  char string[10];
  cout<<"Enter a word ";
  cin>>string;
  makeUpper(string);
  return 0;
}


Try this and tell me if you succeed. I will be glad to hear that. However, if you encounter any problem, you can ask me.
Regards

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Tehreem

Expertise

I can answer questions related to C++ coding and programming techniques.

Experience

I am a C++ programmer.

Organizations
University of Engineering & Technology Lahore

Publications
http://recurseit.blogspot.com

Education/Credentials
I am doing BSCS.

©2016 About.com. All rights reserved.