#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;
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;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];
counter=0;
for(i=0;i<n;i++)
{
counter++;
if(a[i]>=50)
{
n++;
for(j=n-1;j>=counter-1;j--)
a[j+1]=a[j];
a[counter-1]=50;
goto yyy;
}
}
yyy:
cout<<"\t\t***************************\t\t";
cout<<" \n The given array after add 50 is \n\n ";
for(i=0;i<n;i++)
cout<<"\t"<<a[i];
getch();
}
هههههه عفواً أختي هذا هو البرنامج الصحيح إللي أعطيتك ياه قبل التعديل بس إيش إللي جابه
على العموم هذا برنامج صحيح 100% لاتجنني بي هذي حاجات سهلة ما يغلط بها واحد عبقرينوا مثلي
<< خراااااااااط
تحياتي وجربييييييييه ضروري
Bookmarks