Write a program that prompts the user to input a string and
Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use a character array to store the string.) C++
Solution
#include <iostream>
#include <stdio.h>
using namespace std;
int main() {
// your code goes here
char str[100];
cout << \"Input a string : \";
cin >> str;
int i = 0;
char c;
while(str[i])
{
c = str[i++];
putchar(toupper(c));
}
return 0;
}
