Skip to content

Commit

Permalink
printing patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
nihalxkumar committed Mar 12, 2024
1 parent 1d0c170 commit 1c3c570
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions src/Learning-C/Control_Statements_Patterns.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
* Count the number of lines and loops for the same
* Find relation between line number, number of characters and spaces in that line. Apply loop for the same.
1. Count the number of lines and loops for the same
2. Find relation between line number, number of characters and spaces in that line. Apply loop for the same.


```
Expand Down Expand Up @@ -61,6 +61,7 @@ for (l = 1; l <= 4; l++){
```
<details>
<summary>Code</summary>

```C
for (l = 1; l <= 7; l++)
{
Expand Down Expand Up @@ -215,7 +216,7 @@ for (l = 1; l <= 4; l++){
-->

<!--

```
abcdefgfedcba
abcdef fedcba
Expand All @@ -229,33 +230,35 @@ a a
<details>
<summary>Code</summary>

```C
```C

#include <stdio.h>

int main() {
int end = 5; s1 = 2;
char end = 'g';
int main(){
int l, s, s1 = -2 ;
char ch, ch1, end = 'g';

for (l = 1; l <= end; c++){
for( ch = 'a', l <= end; ch++){
for (l = 1; l <= end; ch++){
for(ch = 'a'; l <= end; ch++;){
printf("%c", ch);
}
for(s = 0; s <= s1; s++){
printf(" ");
s1 += 2;
}
s1 += 2;
for(l == 1){
c--;

if(l == 1){
end--;
}
for(ch1 = ch-1, c >= 'a'; ch1--){
for(ch1 = ch-1; ch1 >= 'a'; ch1--;){
printf("%c", ch1);

}
end--;
printf("\n");
}
}
```

</details>

-->

0 comments on commit 1c3c570

Please sign in to comment.