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)

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

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes