bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

pc005.c (652B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 12 Dec 2025
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* Pattern :
      8     1
      9     1   2
     10     3   5   8
     11     13  21  34  55
     12     89  144 233 377 610
     13 for n = 5
     14 */
     15 
     16 #include <stdio.h>
     17 int main()
     18 {
     19     int i, j, n;
     20     long long temp1 = 0, temp2 = 1, temp3;
     21     printf("Enter n : ");
     22     scanf("%d", &n);
     23     printf("1\n");
     24     for (i = 2; i <= n; i++)
     25     {
     26         for (j = 1; j <= i; j++)
     27         {
     28             temp3 = temp1 + temp2;
     29             printf("%lld\t", temp3);
     30             temp1 = temp2;
     31             temp2 = temp3;
     32         }
     33         printf("\n");
     34     }
     35     return 0;
     36 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror