Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the output produced by the program below? #include #include using namespace std; int main ( ) { string name = CoMPutER; for (

What is the output produced by the program below?
#include
#include
using namespace std;
int main()
{
string name = "CoMPutER";
for (int x =0; x < name.size(); x++)
if (islower(name [x]))
name [x]= toupper(name[x]);
else
if (isupper(name[x]))
if (x %2==0)
name[x]= tolower(name[x]);
else
name[x]= name[x-1];
cout << name;
return 0;
}
a.
CoMPutEr
b.
cOmpUTeR
c.
coMMutEE
d.
cOmmUTee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions