Page Contents
Interview Content
- C Programming Coding Questions
- C Pattern Programming Questions
- C Programming Interview Questions
- Java Programming Coding Questions
- Java Pattern Programming Questions
- Java Programming Interview Questions
- Python Programming Coding Questions
- Python Pattern Programming Questions
- Python Programming Interview Questions
- SQL Interview Questions
Floyd’s Triangle Program in C with explanation
In this tutorial we will learn how to write floyd’s triangle program in C.
But before moving on writing program lets know
What is Floyd's Triangle?
Floyd’s triangle is a right angled triangle, which is made using natural numbers. It is named on Rober Floyd.
Its element is left aligned in which it started filling the rows starting with 1 and then fill with consecutive numbers.
#include<stdio.h>
#include<conio.h>
void main(){
int i,j,k=1,n;
printf("enter the value of n:");
scanf("%d",&n);
for(i = 1; i <= n; i++) {
for(j = 1;j <= i; j++)
printf("%4d", k++);
printf("\n");
}
getch();
}
Output
Latest Uploads on Website
- AVL Tree with explanation
- Radix sort algorithm explanation with example
- Quick Sort Algorithm with explanation
- Bubble sorting algorithm with Bubble sort program in C
- Insertion sort algorithm and program in C
- Selection Sort Algorithm and Program in C
- Linear probing technique explanation with example
- Collision in Hashing and Collision resolution technique
- Hashing in data structure with its types
- Binary search tree operations with Program
- Binary search tree in data structure
- Binary search algorithm in data structure with explanation
- linear search in data structure with Algo and Program