You are on page 1of 1

Array Example1

============================================
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
clrscr();
int a[10],sum=0;
for (int i=0;i<10;i++)
{
a[i]=1+rand()%100;
sum=sum+a[i];
}
for (int j=sum;j>=1;j--)
{
for (int k=0;k<10;k++)
{
if (a[k]==j)
cout<<a[k]<<" ";
}
}
getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006