Reverse of Floyd triangle
Answers
Answered by
0
Answer:
may be this is the answer
Explanation:
// CPP 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;
}
THIS IS THE ANSWER MARK ME AS BRAINLIEST!!
Answered by
1
Answer:
printf("Enter the no of lines\n");
- scanf("%d",&n);
- printf("Reverse of Floyd's Triangle\n"); int k = (n*(n+1))/2;
- for(i=n;i>=1;i--) {
- for(j=i;j>=1;j--,k--) {
- printf("%4d", k); //4 spaces. }
hope it helps you
pls mark as brainliest
Similar questions