Table of Contents
In this article, we will discuss Floyd’s triangle number Pattern in C Language using for loop
In this post, we are going to learn how to create Floyd’s triangle number pattern using for loop
Program 4
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i,space,rows,k=0, count=0,count1=0;
printf(“Enter number of rows:n”);
scanf(“%d”,&rows);
for(i=1; i<=rows; ++i)
{
for (space=1; space<=rows-i; ++space)
{
printf(” “);
++count;
}
while(k!=2*i-1)
{if(count<=rows-1)
{
printf(“%d”,i+k);
++count;
}
else
{
++count1;
printf(“%d”,(i+k-2*count1));
}
++k;
}
count1=count=k=0;
printf(“n”);
}
return 0;
}
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.