اعرف انى اثقلت عليكم كتيرا بطلباتى ولكن ...
كيف استطع ان أصمم برنامج أدخل فيه مجموعة من الاسماء ثم اضغط على زر يختار اسم من بين مجموعة الاسماء عشوائياً ومع كل تغطة يتغير الاسم.
ولكم جزيل الشكر ووافر الاحترام ...![]()
اعرف انى اثقلت عليكم كتيرا بطلباتى ولكن ...
كيف استطع ان أصمم برنامج أدخل فيه مجموعة من الاسماء ثم اضغط على زر يختار اسم من بين مجموعة الاسماء عشوائياً ومع كل تغطة يتغير الاسم.
ولكم جزيل الشكر ووافر الاحترام ...![]()
use the Random class to select a random name...
specify the range of random numbers to generate...
#include <stdio.h>
#include <stdlib.h>
int main ()
{
char input;
char *names [] = {"Saleh", "Ali", "Fatima",
"Talal", "Layla", "Yuhanna",
"Ramsis", "Hekmat", "Mustafa"};
puts ("Press Enter to for more names, or 'q' to quit");
input = getchar ();
while (input != 'Q' && input != 'q') {
printf ("%s\n", names[ rand() % 8]);
input = getchar ();
}
}
Dear عابر سـبيل,Download the program please to see what you want...The idea is that you add several names to a listbox and then click on a button then it will choose a name from the listbox randomly...Best regardsFiras S Assaad
شكرا جدا على حل استفسارى وانا أخجل أنا معظم مشاركاتى بهذا المنتدى هى اسئلة ...![]()