ITCS Student
Well-Known Member
- تاريخ التسجيل
- 13 سبتمبر 2011
- المشاركات
- 562
- المجموعة
- ذكر
- الدفعة الدراسية
- معلومة خاصة
- الكلية
- كلية تقنية المعلومات
- التخصص
- CS
^^
حاضرين
حاضرين
^^
صباح الخير
هلا اخوي
اممم اما انا مافهمت قصدك او انت ماقريت ردي



انا حضرت كل لكاجر ماله (لسنر)شعب من في سكشن 1
#include <iostream>
using namespace std;
int main()
{
int array[10]={10,20,30,40,50,60,70,80,90,80} , key , index;
bool found = false ;
cout<< "Enter the number you want to find = "<<endl;
cin>> key;
for(int i=0; i<10; i++)
{
if (array[i] == key) // if number is found
{
found = true;
index=i; // index = i , to use(index) later .
break ; // break out of for loop
}
}
if (found)
cout<< "Your number is at " << index <<".\n";
else
cout<< "Sorry,Your number is not in array"<<endl;
system("pause");
return 0;
}
#include <iostream>
using namespace std;
void searchfun(int array[10], int key2)
{
int index;
bool found = false ;
for(int i=0; i<10; i++)
{if (array[i] == key2)
{found = true;
index=i;
break ;
}
}
if (found)
cout<< "Your number is at " << index <<".\n";
else
cout<< "Sorry,Your number is not in array"<<".\n";
}
int main()
{
int array[10]={10,20,30,40,50,60,70,80,90,80} , key ;
cout<< "Enter the number you want to find = "<<endl;
cin>> key;
searchfun(array, key);
system("pause");
return 0;
}
while(key!=-1)

ممكن شرح للدرس الاول محتاجتنه ضروري مش فاهمه شي بليززز![]()
ربي يوفقنك .. بس عاد انا طماعه بدي الدرس الثاني واكون شاكره![]()
حتى الدرس الثاني شرحت اول جزء منه اللي هو sequential search
شوفي الصفحه 3 ثاني رد
باقي ال sorting
بعدين ان شاء الله
ربي يوفقكم جميع 
الله يسلمشيسلمو صدقه انكم فلهربي يوفقكم جميع
![]()
حتى الدرس الثاني شرحت اول جزء منه اللي هو sequential search

شعب من في سكشن 1
احتاج شرح الجزء الثاني منه![]()
ما فهمت شرح الدكتور و عطتنا سؤال نحله![]()
void bubbleSort(int list[] , int length)
{
int temp , iteration , index ;
for (iteration =1 ; iteration<length ; iteration++)
{
for( index =0 ; index <length - iteration ;index++)
if (list[index] > list[index + 1])
{ temp = list[index];
list[index] = list[index + 1];
list[index + 1] = temp;
}
}
}