Skip to content
This repository has been archived by the owner on Jul 10, 2024. It is now read-only.

Commit

Permalink
R program to print pattern 1 (#4820)
Browse files Browse the repository at this point in the history
* Written R program to print ascii value of a character

* r program to print pattern 1

---------

Co-authored-by: ApurvaR1 <ApurvaR1@gmail.com>
Co-authored-by: Harsh Raj <harshraj8843@gmail.com>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent cf2e634 commit 3323102
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions program/program/print-pattern-1/print_pattern_1.r
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
printPattern <- function(n) {
for (i in 1:n) {
for (j in 1:i) {
cat(j, " ")
}
cat("\n") # Move to the next line after each row
}
}

# Test the function with input 5
printPattern(5)

0 comments on commit 3323102

Please sign in to comment.