C++ Program To Print Reverse Floyd's Triangle Last Updated : 23 Jul, 2025 Comments Improve Suggest changes Like Article Like Report Floyd’s triangle is a triangle with first natural numbers. Task is to print reverse of Floyd’s triangle.Examples: Input: 4 Output: 10 9 8 7 6 5 4 3 2 1 Input: 5 Output: 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 C++ // C++ program to print reverse // of Floyd's triangle #include <bits/stdc++.h> using namespace std; void printReverseFloyd(int n) { int curr_val = n * (n + 1) / 2; for (int i = n; i >= 1; i--) { for (int j = i; j >= 1; j--) { cout << setprecision(2); cout << curr_val-- << " "; } cout << endl; } } // Driver's Code int main() { int n = 7; printReverseFloyd(n); return 0; } Output: 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 Comment More info K kartik Follow Improve Article Tags : C++ Programs C++ C++ Pattern Programs Explore C++ BasicsIntroduction to C++3 min readData Types in C++6 min readVariables in C++4 min readOperators in C++9 min readBasic Input / Output in C++5 min readControl flow statements in Programming15+ min readLoops in C++7 min readFunctions in C++8 min readArrays in C++8 min readCore ConceptsPointers and References in C++5 min readnew and delete Operators in C++ For Dynamic Memory5 min readTemplates in C++8 min readStructures, Unions and Enumerations in C++3 min readException Handling in C++11 min readFile Handling through C++ Classes8 min readMultithreading in C++8 min readNamespace in C++5 min readOOP in C++Object Oriented Programming in C++8 min readInheritance in C++6 min readPolymorphism in C++5 min readEncapsulation in C++4 min readAbstraction in C++4 min readStandard Template Library(STL)Standard Template Library (STL) in C++3 min readContainers in C++ STL3 min readIterators in C++ STL10 min readC++ STL Algorithm Library3 min readPractice & ProblemsC++ Interview Questions and Answers1 min readC++ Programming Examples4 min read Like