|
| BF4 | |
|
| Facebook | |
|
|
|
|
by: Oðuz Ata - 23 Mart 2019 Cumartesi 14:10:19
#include
#define basamak 20
int main()
{int sonuct[basamak],sonucf[basamak];
float sayi,f;
int tk=0,d,c,kk=0,kf=0,i;
printf("Sayi:");
scanf("%f",&sayi);
printf("Taban:");
scanf("%d",&c);
d=(int)sayi;
f=sayi-d;
do{
sonuct[kk]=d%c;
d=d/c;
kk++;
if(d
sonuct[kk]=d%c;
kk++;break;
}
if(kk==basamak)break;
}
while(d>=c);
do{
f=f*c;
printf("\n%f",f);
sonucf[kf]=(int)f;
kf++;
f=f-(int)f;
if(kf==basamak)break;
}while(f!=0);
printf("\nSONUC\n");
//YAZDIRMA
for(i=kk-1;i>=0;i--){
printf("%d",sonuct[i]);
}
printf(".");
for(i=0;i
printf("%d",sonucf[i]);
}
return 0;
}
/*Oguz ATA*/
viewed 3934 times -
|
|
|
|
|
| Sınav Soruları | |
|
|
|