Answer to Question #147614 in C++ for Usama saleem

Question #147614
Write a program which takes as input an integer from the user, and displays the corresponding character. For example if the user enters 65, 'A' would be shown on the screen. The program should also take as input a lowercase character and then displays the uppercase form of it. For example if the user enters 'a', 'A' would be shown on the screen. The program should also make a beep sound before ending.
1
Expert's answer
2020-11-29T23:49:17-0500
#include <iostream>

using namespace std;

int main() {
    char c;
    int x;
    cin >> x;
    cout << char(x) << '\n';
    
    cin >> c;
    c = 'A' + (c - 'a');
    cout << c << '\n' <<'\a';
    
}

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 the first!

Leave a comment