بســم الله الـرحمــن الرحيــم
السلام عليكــم ورحمـة الله وبركاتــة
عدنا من جديد ولكن بموضوع جديد
هذه المرة مطلوب مني ان ارتب و احذف الارقام المكررة في
random numbers
التي تخرج وهذا ما توصلت اليه لكن المشكلة ان لا توجد اي الرقام اصلا هل ممكن خطا في الكود ارجو المساعدة
- #include <stdio.h>
- #include <stdlib.h>
- #define SIZE 30
- int main()
- {
- int numbers[SIZE];
- int count;
- int temp;
- int numbers_check[SIZE];
- FOR( count = 0; count < SIZE; count++ )
- {
- numbers_check[count] = 0;
- }
- FOR( count = 0; count < SIZE; count++ )
- {
- do
- {
- numbers[count] = rand() % 10 + 1;
- }
- while ( numbers_check[temp] != 0);
- {
- numbers_check[temp] = 1;
- numbers[count] = temp;
- }
- }
- printf( "Starting numbers: " );
- FOR( count = 0; count < SIZE; count++ )
- {
- printf( "%2d. %2dn ", count, numbers[count] );
- }
- printf( "n" );
- RETURN( 0 );
- }

