Skip to content

Commit

Permalink
Program to Print a Half-Pyramid Using Numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sagar-Sharma-7 committed Aug 17, 2023
1 parent 994ad72 commit a258f45
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pattern3.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Program to Print a Half-Pyramid Using Numbers
#include <iostream>
using namespace std;

int main(){
int num;
cout << "Enter your number: ";
cin >> num;

int i = 1;
for(; i<= num;i++){
int j = 1;
for(; j <= i; j++){
cout << j << " ";
}
cout << endl;
}
return 0;
}
Binary file added pattern3.exe
Binary file not shown.

0 comments on commit a258f45

Please sign in to comment.