Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pattern Questions #165

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n = int(input())
j = 0
for i in range(n, 0, -1):
print(" "*j, end = "")
print("* "*i, end = "")
j += 1
print()

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
print("*")
for i in range(1, n):
print(" "*i, end = "")
print("*")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
for i in range(n-1, 0, -1):
print(" "*i, end = "")
print("*")
print("*")
13 changes: 13 additions & 0 deletions Web/1010varun_varunagarwal_2125csai1023_2/Pattern/pattern_7.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <iostream>
using namespace std;
int main() {
int n, k = 1;
cin >> n;
for(int i = 0; i <= n; i++){
for(int j = 0; j < i; j++){
printf("%d ", k);
k ++;
}
cout << endl;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include<iostream>
using namespace std;
int main(){
int n;
cin >> n;
for(int i = 1; i <= 10; i++){
cout << n << " * " << i << " = " << n*i << endl;
}
}