Breaking News
Loading...

Find sum of array element . Then sort the element


#include<stdio.h>
#include<conio.h>
void main()
{
 int a[10],i,j,s=0;
 clrscr();

 printf("Enter the elements of The Array: ");
  for(i=0;i<10;i++)
  {
    scanf("%d",&a[i]);
    s=s+a[i];
   }

  for(i=0;i<s;i++)
  {
   for(j=0;j<10;j++)
   {
     if(a[j]==i)
printf("%d ",a[j]);
    }
  }
 getch();
}

1 comments:

  1. Thanks for this it helps a lot
    TechzTricks hope to see more program here

    ReplyDelete

 
Toggle Footer