Answers for "floyd-Triangle in c++"

C++
0

floyd-Triangle in c++

#include<iostream>
using namespace std;

int main(){
    int num, count = 1;
    cin>> num;

    for (int i = 1; i <= num; i++)
    {
        for (int j = 1; j <= i ; j++)
        {
            cout << count << " ";
            count ++;
        }
            cout << endl;
        
    }
    
    return 0;
}
Posted by: Guest on July-17-2021

Browse Popular Code Answers by Language