Question

Instructions Write a program that produces the following output: CCCCCCCCC ++ ++ CC ++ ++ CC...

Instructions

Write a program that produces the following output:

CCCCCCCCC       ++              ++
CC              ++              ++
CC        ++++++++++++++  +++++++++++++++
CC        ++++++++++++++  +++++++++++++++
CC              ++              ++
CCCCCCCCC       ++              ++

Note: The letter C in the output must be uppercase.

#include <iostream>

using namespace std;

int main()

{

  cout<<"CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC +++++++++++++\n";

  cout<<"+++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++";

  return 0;

}


this is my woek
#include <iostream>
using namespace std;
int main()
{
cout<<"CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++\n";
cout<<"+++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++"; return 0;}

Instructions

Write a program that produces the following output:

CCCCCCCCC ++ ++
CC ++ ++
CC ++++++++++++++ +++++++++++++++
CC ++++++++++++++ +++++++++++++++
CC ++ ++
CCCCCCCCC ++ ++
Note: The letter C in the output must be uppercase.

Homework Answers

Answer #1

Code :

#include <iostream> // standard library for input and output
using namespace std;
int main() // main function with return type integer
{
cout<<"CCCCCCCCC ++ ++ CC ++ ++ CC ++++++++++++++ +++++++++++++++ CC ++++++++++++++\n";
cout<<"+++++++++++++++ CC ++ ++ CCCCCCCCC ++ ++";
return 0;//return 0 to the function
}

Output :

Code :

#include <iostream> //standard library for input and output

using namespace std;

int main() //main function
{
cout<<"CCCCCCCCC ++ ++\nCC ++ ++\n"; //print the statement
cout<<"CC ++++++++++++++ +++++++++++++++\n";//print the statement
cout<<"CC ++++++++++++++ +++++++++++++++\n";//print the statement
cout<<"CC ++ ++\nCCCCCCCCC ++ ++"; //print the statement
return 0; //return the 0 to function main;
}

Output :

I answered both questions ,if you need any modifications or add anything or make it in different way please leave a comment....

Otherwise please give positive rating if it useful to you.....

Thank you........

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Analyze the following programs and write down the output of the program. Please print every character...
Analyze the following programs and write down the output of the program. Please print every character (including whitespace character) clearly!       # include <iostream> using namespace std;   int fun( int a ) {       int b = a * 2;       return b;   }   int main()   {       int y = 5;       cout << fun(y) << endl;       cout << fun(-- y) << endl;       cout << fun(y--) << endl;       cout << y <<endl;           return 0;   }
How to trace a c++ program by hand #include<iostream> using namespace std;    class Test {...
How to trace a c++ program by hand #include<iostream> using namespace std;    class Test {     int value; public:     Test(int v); };    Test::Test(int v) {     value = v; }    int main() {     Test t[100];     return 0; } _______________ #include <iostream> using namespace std; int main() { int i,j; for (i=1; i<=3; i++) { for(j=1; j<=i; j++ ) { cout<<"*"; } cout << "\n";   } return 0; }
Analyze the following program and write down the output. # include <iostream> using namespace std;    void...
Analyze the following program and write down the output. # include <iostream> using namespace std;    void modifyArray( int [ ], int );    void modifyElement ( int );      int main( ) {   const int arraySize = 8;   int a[arraySize] = { 2, -2, 10, -3, -1 ,0, 10, -5 };      modifyArray ( a, arraySize);      for ( int i =0; i < arraySize; i++)               cout << a[i] << ‘  ’;         modifyElement ( a[4] );          for ( int i =0; i <...
Write a program containing a function, reverseDigit, that takes an integer as a parameter and returns...
Write a program containing a function, reverseDigit, that takes an integer as a parameter and returns the number with its digits reversed, then printout the return result. For example, the value of reverseDigit(12345) is 54321; the value of reverseDigit(5600) is 65; the value of reverseDigit(7008) is 8007; and the value of reverseDigit(-532) is -235.    Modify the following program to make a correct output. /* // Name: Your Name // ID: Your ID // Purpose Statement: ~~~ */ #include <iostream>...
This is the program that I need to make. Write a program that prints three items,...
This is the program that I need to make. Write a program that prints three items, such as the names of your three best friends or favorite movies, on three separate lines. This is what I did. #include <iostream> using namespace std; int main() { cout << "Suresh" << endl; cout << "Sekhar" << endl; cout << "Anshu" << endl; return 0; } Then it tells me that the program fails to test the submission with three random names. Please...
Write a program that prompts the user to input a string and outputs the string in...
Write a program that prompts the user to input a string and outputs the string in uppercase letters. (Use dynamic arrays to store the string.) my code below: /* Your code from Chapter 8, exercise 5 is below. Rewrite the following code to using dynamic arrays. */ #include <iostream> #include <cstring> #include <cctype> using namespace std; int main() { //char str[81]; //creating memory for str array of size 80 using dynamic memory allocation char *str = new char[80]; int len;...
1) What do you think the following program will print if you type from the keyboard...
1) What do you think the following program will print if you type from the keyboard the numbers 3 for a and 8 for b ? #include < iostream> using namespace std; int main() { int a, b; cin >> a >> b; if (a > b && b > 7) { if(a < 7) cout << “ a less than 7: “ << a << ‘\n’; else cout << “Else branch executed\n”; return 0; }
Please write variables and program plan (pseudocode) of the C++ programming below: #include <iostream> #include <cmath>...
Please write variables and program plan (pseudocode) of the C++ programming below: #include <iostream> #include <cmath> using namespace std; void divisors(int num); int main () {    char repeat;    int num;       while (repeat !='n')    {        cout << "Enter a number: ";        cin >> num;        divisors(num);        cout << "Continue? (y or n): ";        cin >> repeat;    }    return 0; } void divisors(int num) {   ...
Write a program which inputs an integer value, incr, from the user at the keyboard, and...
Write a program which inputs an integer value, incr, from the user at the keyboard, and then displays a graph of the sine of the degree values from 0 to 180, in increments of incr. You must use the sin function (in a similar manner to ceil and floor) to find the sine. Note that the sin function only operates on radians so the degree value must first be converted to radians. To do so, multiply the degree value by...
C++ programming Write a program that reads a comma-separated file (CSV) with integer values and prints...
C++ programming Write a program that reads a comma-separated file (CSV) with integer values and prints the number of integer values in the file. Your program's input will be a string with the name of the file. If the file does not exist, then the program must print: Error opening the file For example, given the following CSV file input1.csv: 1,10,20,30,40 The output of your program must be: 5 You can safely assume that the input file will be a...