Horje
make an x using asterisk c++ Code Example
make an x using asterisk c++
//This is one that will involve user input to create an "X" using
//Asterisks.

#include <iostream>
using namespace std;
int main() {
  int size;
  
  cout << "This is where you ask for size: ";
  cin >> size;
  
  for(int i = 1;i <= size; i++) {
    for(int j = 1; j<= size; j++) {
      if((i == j) || (j == (size + 1) - i)) {
        cout << "*";
      } else {   
        cout << " ";
      }
    }
    cout<< endl;
  }
}




Cpp

Related
how to shorten code using using c++ in class with typename Code Example how to shorten code using using c++ in class with typename Code Example
changing values of mat in opencv c++ Code Example changing values of mat in opencv c++ Code Example
create a bitset of 1024 bits, Code Example create a bitset of 1024 bits, Code Example
c++ anti debugging Code Example c++ anti debugging Code Example
qt graphics scene map cursor position Code Example qt graphics scene map cursor position Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8