I/O Operations Print Floyd's
QUESTION DESCRIPTION
Create a logic to print Floyd's triangle upto the given n rows.
Refer Sample Test Cases.
Programming Language need to be used:C++
Create a logic to print Floyd's triangle upto the given n rows.
Refer Sample Test Cases.
Programming Language need to be used:C++
TEST CASE 2
INPUT
INPUT
4
OUTPUT1
23
456
78910
#include <iostream>
using namespace std;
int main()
{
int n, i, c, a = 1;
cin >> n;
for (i = 1; i <= n; i++)
{
for (c = 1; c <= i; c++)
{
cout << a;
a++;
}
cout << endl;
}
return 0;
}
Comments
Post a Comment