Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

rectangular or square star and number pattern in C using for loop

Posted on December 1, 2016January 29, 2020

Table of Contents

  • rectangular or square star and number pattern in C using for loop
      • C program to print the rectangular shape using star
      • C program to print the rectangular shape using numbers
      • C program to print the rectangular pattern using star. (get input method)
      • C program to print the rectangular pattern Using star. (get input  row and column)
    • Related

rectangular or square star and number pattern in C using for loop

In this article, we will discuss the rectangular or square star and number pattern in C using for loop

In the C Language, We can print various type of Rectangular shapes through nested for loop using number and special character

C program to print the rectangular shape using star

Examples

Program 1

#include <stdio.h>
#include <stdlib.h>

int main()
{
int row;
int coloum;
for(row=1; row<=10; row++){

for(coloum=1; coloum<=10; coloum++){

printf(“*”);
}
printf(“n”);
}
return 0;
}

When the above code is executed ,it produces the following result

rectangular or square star and number pattern in C using for loop
Example

 

C program to print the rectangular shape using numbers

program 2

#include <stdio.h>
#include <stdlib.h>

int main()
{
int row;
int coloum;
for(row=1; row<=10; row++){

for(coloum=1; coloum<=10; coloum++){

printf(“%d”,coloum);
}
printf(“n”);
}
return 0;
}

When the above code is executed ,it produces the following result
rectangular or square star and number pattern in C using for loop
Eample

C program to print the rectangular pattern using star. (get input method)

Program 3
 

#include <stdio.h>
#include <stdlib.h>

int main()
{
int num, row, coloum;
printf(“Enter Number of row to be disply :n “);
scanf(“%d”,&num);
for(row=1; num>=row; row++)
{
for(coloum=1; coloum<=num; coloum++)
{
printf(“*”);
}
printf(“n”);
}
return 0;
}

When the above code is executed ,it produces the following result

rectangular or square star and number pattern in C using for loop
Example

C program to print the rectangular pattern Using star. (get input  row and column)

Program 4

#include <stdio.h>
#include <stdlib.h>
int main()
{
    int num1,num2, row, coloum;
    printf(“Enter Number of row to be display :n “);
    scanf(“%d”,&num1);
    printf(“Enter Number of coloum to be display :n “);
    scanf(“%d”,&num2);
    for(row=1; num1>=row; row++)
    {

 

        for(coloum=1; coloum<=num2; coloum++)
            {
            printf(“*”);
            }
        printf(“n”);
    }
    return 0;
}
When the above code is executed ,it produces the following result
rectangular or square star and number pattern in C using for loop
Example
Suggested for you
Hollow square star pattern in C using loops
Solod square star pattern in C using loops
Hollow pyramid star pattern in C using loops
Pyramid star pattern in C using loops
Inverted pyramid star pattern in C
invetred hollow pyramid star pattern in C

Related

Recent Posts

  • Multiply two numbers in Java using scanner| 5 different ways
  • 5 different ways to Divide two numbers in Java using scanner
  • Learn 8 Ways to Subtract Two Numbers Using Methods in Java
  • 10 ways to subtract two numbers in Java
  • Java Code Examples – Multiply Two Numbers in 5 Easy Ways
  • How to Divide two numbers in Java| 5 different ways

tag

Addition (8) Array (38) C++ language (91) C language (98) c sharp (23) Division (8) Function (29) if else (32) Java language (108) JavaScript (5) loops (138) Multiply (8) Oop (2) patterns (66) PHP (13) Python Language (38) Subtraction (9) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2026 Code for Java c | Powered by SuperbThemes