Array Descending Order

Problem: Array Ascending Order 
#include<stdio.h>     

#include<conio.h>

void main(void)

{

clrscr();

int i,j,c,num,a[100];

printf(“\nProg: Ascending Order”);

printf(“\nEnter How many Number:..”);

scanf(“%d”,&num);

printf(“\nEnter Integer:”);

for(i=0;i

{

scanf(“%d”,&a[i]);   /* input data */

}

for(i=0;i

{

for(j=i+1;j<num;j++)

{

if(a[i]>a[j])

{

c=a[i];

a[i]=a[j];

a[j]=c;

}

}

}

printf(“\nAscending Order:”);   /* Sorting Ascending Order */

for(i=0;i<num;i++)

{

printf(“\n%d”,a[i]);

}

getch();

}

Problem 04 | ArrayClass function

Problem : Take 10 Number as input, print 5th Number in another function

#include<stdio.h>

#include<conio.h>

#define n 10

void sum(int a);

/* prototype function */   void main(void)

{

clrscr();

int i,A[n];

printf(“\nEnter Number:…”);

for(i=1;i

sum(A[5]);        /*call function & print 5th number */

getch();

}

void sum(int a)

{

printf(“\nResult:%d”,a);

}