Search
 
SCRIPT & CODE EXAMPLE
 

CPP

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;
  }
}
Comment

PREVIOUS NEXT
Code Example
Cpp :: qregexpvalidator qlineedit email address 
Cpp :: why ostream cannot be constant 
C :: _CRT_SECURE_NO_WARNINGS 
C :: csrf_exempt 
C :: docker: Error response from daemon: could not select device driver "" with capabilities: [[gpu]]. 
C :: matplotlib legend remove box 
C :: terminal count files in directory 
C :: debian apt force overwrite 
C :: wireless app debug android 
C :: c random list 
C :: c program to find area of circle 
C :: c code to python code converter online 
C :: get chunks of a mp4 in ffmpeg 
C :: boilerplate code c 
C :: arduino client disconnect 
C :: C percentage program 
C :: c program 
C :: create empty vector in rust 
C :: find length of int number in c 
C :: c check if char is an operator 
C :: install tweaks ubuntu 
C :: Counting Sort C 
C :: what is syntax in programming 
C :: get float in c 
C :: c programming language 
C :: arrays in c 
C :: program to find the average of n numbers using arrays. 
C :: declare string in c 
C :: KneesDev 
C :: delay in c programming for linux 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =