#include<iostream.h>
#include<conio.h>
main()
{
clrscr();
int i*j*n*counter=0*temp;
int a[20];
cout<<"\n***** this program is created by Eng.Sameh ^_^ *****\n" ;
cout<<"\n***** Enter the number of element's of the array *****\n" ;
cin>>n;
سؤال هنا .. عند اضافة العناصر الثمانيه .. بعدها يجي العنصر التاسع فاضي يعني null طيب حطينا قيمتها null او وضعنا فيها قيمه اخرى .. النتيجة بتطلع فيها ارقام عجيبة اخر اربعة ارقام
for(i=0;i<n;i++)
{
cout<<"a["<<i<<"]= ";
cin>>a[i];
}
cout<<"\t\t***************************\t\t";
cout<<" \n The given array is \n\n ";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
cout<<"\n\n\t\t***************************\t\t";
cout<<"\n\nThe number of the element's whitch has the value less than 50 is \t";
for(i=0;i<n;i++)
{
if(a[i]<50)
counter++;
}
cout<<counter;
cout<<"\n\n\t\t***************************\t\t";
cout<<"\n\nNow we will sort the array ^_^ \n\n";
for(i=0;i<n;i++)
for(j=i+1;j<n+1;j++)
if(a[j]<a[i])
{
temp=a[i];
a[i]=a[j];
a[j]=temp;
}
cout<<"\t\t***************************\t\t";
cout<<" \n The given array is \n\n ";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
getch();
}