Arama butonu
Bu konudaki kullanıcılar: 1 misafir
4
Cevap
1677
Tıklama
0
Öne Çıkarma
C Dizi de oluşturlan bir değere rastgele sayı atama
H
7 yıl (5779 mesaj)
Yüzbaşı
Konu Sahibi

Arkadaşlar şöyle bir sorunum var Bir struct olşturdum ögrenci diye ad ve soyad kısmını klavye ile kullanıcıya girdiyorum. Bunda bir sorun yok fakat ögrenci numarasını sistemin rastgele oluşturmasını istiyorum. Bunu nasıl yapabilirim.

struct Ogrenci{
char ad[10];
char soyad[10];
int ogrenci_no;
};


void mogrencibilgi (Ogrenci *pt);

void mogrencibilgi (Ogrenci *pt){
for(int i=0; i<10; i++){
printf("\n Adini Giriniz=");
scanf("%s",pt.ad);
printf("\n Soyad Giriniz=");
scanf("%s",pt.soyad);

}
for(int i=0; i<10; i++){
printf("\n Adiniz ve Soyadiniz: %s %s Ögrenci no : %s", pt.ad, pt.soyad, pt.ogrenci_no);


}
}

Nasıl yapabilirim. Teşekkürler şimdiler