60 608
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #1579 in C++ for Dwayne

Question #1579
Write a function called Reverse() which takes a string as a parameter. The function should convert all lower case letters to upper case and upper case letter to lower case.

Expert's answer
// Lowercaseletterstoupper.cpp : Defines the entry point for the console application.//
#include "stdafx.h"
#include #include #include using namespace std;

char str[80];
char string;
int i;

void Reverse(char str[80]){
for( i = 0; str[ i ]; i++){
str[ i ] = toupper( str[ i ] );
}
printf("Uppercase string is - %s
", str); /* uppercase string */

for(i = 0; str[ i ]; i++){
str[i] = tolower(str[ i ]);
}
printf("Lowercase string is - %s
", str); /* lowercase string */
}

int _tmain(int argc, _TCHAR* argv[])
{
printf("Enter a string: ");
Reverse(gets(str));
getch();
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions