What is the output of the following program lines, when embedded in a correct program that declares all variables to be of type char?
a = 'b';
b = 'c';
c = a;
cout << a << b << c << 'c';
The output of the given program lines:
bcbc
Explanation:
Complete executable program code:
#include <iostream>
using namespace std;
int main ()
{
//Declares all variables to be
//of data type char
char a,b,c;
//Initialize the variables
a = 'b';
b = 'c';
c = a;
//Print output
cout << a << b << c << 'c';
return 0;
}
Output of the program code:
bcbc