Please enter your email:
1. Pattern:
$#$# $#$# $#$# $#$#
Code:
for(i = 1; i <= 4; i++) { for(j = 1; j <= 4; j++) { if( ? ) printf(“$”); else printf(“#”); } printf(“\n”); }
2. Floyd’s Triangle:
1 2 3 4 5 6 7 8 9 10
Code :
num = 1; for(i = 1; ? ; i++) { // Outer Loop for(j = 1; ? ; j++) { // Inner Loop printf(“%d “, num++); } printf(“\n”); }
3. Number Traingle:
1 1 2 1 2 3 1 2 3 4
for(i = 1; ? ; i++) { // Outer Loop for(j = 1; ? ; j++) // Inner Loop printf(“%d “, j); printf(“\n”); }
4. Pattern:
* * * * * * * * * * * * * * * *
for(i = 1; ? ; i++) { // Outer Loop for(j = 1; ? ; j++) // Inner Loop printf(“* “); printf(“\n”); }
5. Pattern:
$#### #$### ##$## ###$# ####$
for(i = 1; i <= 5; i++) { for(j = 1; j <= 5; j++) { if( ? ) printf(“$”); else printf(“#”); } printf(“\n”); }
6. Numbers Pattern:
1 2 3 4 1 2 3 1 2 1
for(i = 4; ? ; i–) { // Outer Loop for(j = 1; ? ; j++) // Inner Loop printf(“%d “, j); printf(“\n”); }
7. Pattern:
* * * * * * * * * *
8. Pattern:
for(i = 4; ? ; i–) { // Outer Loop for(j = 1; ? ; j++) // Inner Loop printf(“* “); printf(“\n”); }
9. Pattern:
$$$$$ $###$ $###$ $###$ $$$$$
10. Pattern:
$$$$# $$$$# $$$$# $$$$# $$$$#
for(i = 1; i <= 5; i++) { for(j = 1; j <= 5; j++) { if( ? ) printf(“#”); else printf(“$”); } printf(“\n”); }
Question 1 of 10
Your email address will not be published. Required fields are marked *
Comment *
Name *
Email *
Website
Save my name, email, and website in this browser for the next time I comment.