Table of Contents
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
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
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;
}
#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
Program 4
Subtract two numbers using method overriding Program 1
PHP Star triangle Pattern program Here's a simple Java program that demonstrates how to print…
Using Function or Method to Write to temperature conversion: Fahrenheit into Celsius In this article,…
Function or method of temperature conversion from Fahrenheit into Celsius In this article, we will…
Write temperature conversion program: from Fahrenheit to Celsius In this article, we will discuss the…
How to write a program to convert Fahrenheit into Celsius In this article, we will…
This website uses cookies.