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 <...
whats the output of the following program? #include <iostream> using namespace std; int main () {...
whats the output of the following program? #include <iostream> using namespace std; int main () { int fistNum = 28; int secondNum = 25; cout << firstNum << " " << secondNum << end1; cout << (firstNum = 38-7) << end1; cout << (firstNum <= 75) << end1; cout << (firstNum > secondNum + 10) << end1; cout << (firstNum >= 3 * secondNum - 100) << end1; cout << (secondNum - 1 == 2 * firstNum) << end1; cout...
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>...
C++ while loop Exercise Write a program that continues to ask the user to enter any...
C++ while loop Exercise Write a program that continues to ask the user to enter any set of numbers, until the user enters the number -1. Then display the total sum of numbers entered and their average. (note that you need to define a counter that counts how many numbers so the average = (sum/n) where n is your counter total. #include <iostream> using namespace std; int main() { int number, n=0, sum=0; cout << "Enter a number to start...
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;...
Im using visual studio to write a c++ program has a function that will output the...
Im using visual studio to write a c++ program has a function that will output the number if ways a person can climb stairs using only 1 or two steps and and function that when given a number outputs the corresponding fibonacci number. I want to call the functions in main. #include <iostream> using namespace std; int FiboNum(int fiboNum); int Stairs(int nStairs); int main() {    int fiboNum;    int nStairs;    cout << "Enter a number : " <<...
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; }
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT