बिजनेस मार्केटिंग का लो कॉस्ट फंडा , अपने मोबाइल से ऑटो sms भेजकर मार्केटिंग करे विजिट करे http://autotextsms.com/ बिजनेस मार्केटिंग का लो कॉस्ट फंडा http://autotextsms.com/

Search This Blog

Translate

Showing posts with label C Program to generate the Pascals Triangle 1D array. Show all posts
Showing posts with label C Program to generate the Pascals Triangle 1D array. Show all posts

C Program to generate the Pascals Triangle 1D array

C Program to generate the Pascals Triangle 1D array 


#include <stdio.h>
 int main()
 { int array[30], temp[30], i, j, k, l, num;
 //using 2 arrays printf("Enter the number of lines to be printed: ");
 scanf("%d", &num);
 temp[0] = 1; array[0] = 1;
 for (j = 0; j < num; j++)
 printf(" "); printf(" 1\n");
 for (i = 1; i < num; i++)
{ for (j = 0; j < i; j++) printf(" ");
for (k = 1; k < num; k++) { array[k] = temp[k - 1] + temp[k]; }
 array[i] = 1; for (l = 0; l <= i; l++)
 { printf("%3d", array[l]); temp[l] = array[l]; }
 printf("\n"); }
 return 0; }

  • pascal triangle using 2d array in c
  • c program to print pascal triangle without using function
  • pascal's triangle using 2d array
  • java program for pascal triangle using array
  • c program to print pascal triangle using while loop
  • pascal triangle in c++using 1d arrays
  • c program to generate pascal triangle using for loop
  • algorithm for pascal triangle



C Program example List