Friday, September 1, 2023

This program builds a pyramid from an asterisks

 // This program builds a pyramid from asterisks  

#include <iostream>

#include <string>

using namespace std;

int main(){

for(int i=1;i<=10; i++)

{

for(int j=1;j<=10-i; j++) cout <<" ";

cout << "*";

for(int j=0;j<=i-2; j++) cout <<"  ";

cout << "*"<< endl;


}

    return 0;

}

No comments:

Post a Comment

NaCl.xyz Generator with Interactive 3D Visualization

NaCl.xyz Generator with Interactive 3D Visualization NaCl.xyz Generator with Interactive 3D Visualization ...