Laplace transforms pdf

CLICK THE LINK BELOW TO DOWNLOAD LAPLACE TRANSFORMS IMPORTANT FORMULAS IN THE FORM OF PDF

CLICK HERE

Sunday, 24 July 2016

Pascal triangle

/*PROGRAM TO PRINT THE PASCAL TRIANGLE  */
#include<stdio.h>
int ncr(int ,int );
int fact(int);
void main()
{
int n,i,j,k;
printf("enter number of rows \n");
scanf("%d",&n);
for(i=0;i<n;i++)
{
for(k=(n-i);k>0;k--)
printf(" ");
for(j=0;j<=i;j++)
{
printf("%d ",ncr(i,j));
}
printf("\n");
}
getch();
}

int ncr(int n,int r)
{
return (((fact(n))/(fact(n-r)*fact(r))));
}

int fact(int n)
{
if(n==0)
return 1;
else
return n*fact(n-1);
}

Bubble sort

/*BUBBLE SORT (ASCENDING AND DESCENDING ORDER ORDER) */

#include<stdio.h>
void main()
{
int n,a[1000],i,j,t;
printf("enter the number of numbers that are to be sorted\n");
scanf("%d",&n);
printf(" enter the elements of the array\n");
for(i=0;i<n;i++)
scanf("%d",&a[i]);
for(i=0;i<n;i++)
     {
   for(j=0;j<n-1-i;j++)
     if(a[j]>a[j+1])
       {
       t=a[j+1];
       a[j+1]=a[j];
         a[j]=t;
         }
      }
printf("\n ASCENDING ORDER :\n"); for(i=0;i<n;i++)
printf(" %d ",a[i]);
printf("\n DESCENDING ORDER:\n"); for(i=n-1;i>=0;i--)
printf(" %d ",a[i]);
}