{"id":11881,"date":"2021-09-30T14:30:37","date_gmt":"2021-09-30T09:00:37","guid":{"rendered":"https:\/\/python-programs.com\/?p=11881"},"modified":"2021-11-22T18:34:31","modified_gmt":"2021-11-22T13:04:31","slug":"python-program-to-print-floyds-triangle","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-program-to-print-floyds-triangle\/","title":{"rendered":"Python Program to Print Floyd\u2019s Triangle"},"content":{"rendered":"

Beginners and experienced programmers can rely on these Best Java Programs Examples<\/a> and code various basic and complex logics in the Java programming language with ease.<\/p>\n

Given the number of rows of the triangle, the task is to print Floyd’s triangle in C, C++, and Python.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number of rows of the triangle = 10<\/pre>\n

Output:<\/strong><\/p>\n

1 \r\n2 3 \r\n4 5 6 \r\n7 8 9 10 \r\n11 12 13 14 15 \r\n16 17 18 19 20 21 \r\n22 23 24 25 26 27 28 \r\n29 30 31 32 33 34 35 36 \r\n37 38 39 40 41 42 43 44 45 \r\n46 47 48 49 50 51 52 53 54 55<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given number of rows of the triangle = 13<\/pre>\n

Output:<\/strong><\/p>\n

1 \r\n2 3 \r\n4 5 6 \r\n7 8 9 10 \r\n11 12 13 14 15 \r\n16 17 18 19 20 21 \r\n22 23 24 25 26 27 28 \r\n29 30 31 32 33 34 35 36 \r\n37 38 39 40 41 42 43 44 45 \r\n46 47 48 49 50 51 52 53 54 55 \r\n56 57 58 59 60 61 62 63 64 65 66 \r\n67 68 69 70 71 72 73 74 75 76 77 78 \r\n79 80 81 82 83 84 85 86 87 88 89 90 91<\/pre>\n

Program to Print Floyd\u2019s Triangle in C, C++, and Python<\/h2>\n

Below are the ways to print Floyd’s triangle in C, C++, and Python.<\/p>\n