Advertisement
crescent72

Untitled

Dec 21st, 2016
332
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.20 KB | None | 0 0
  1.     #include<stdio.h>
  2.     #include<conio.h>
  3.     #include<stdlib.h>
  4.  
  5.     int main()
  6.     {
  7.         float f1= 204, f2= 42;
  8.         int     i1=204, i2=42;
  9.         float fffbolum1, fffbolum2, ddfbolum1, ddfbolum2;
  10.         int   ffdbolum1, ffdbolum2, dddbolum1, dddbolum2;
  11.  
  12.         fffbolum1 = f1 / f2 ;
  13.         ffdbolum1 = f1 / f2 ;
  14.  
  15.         printf("a)%f/%f = %f\n",f1,f2,fffbolum1);//iki tane float sayının float sonucu
  16.         printf("  %f/%f = %d\n",f1,f2,ffdbolum1);//iki tane float sayının int sonucu
  17.  
  18.         fffbolum2 = f2 / f1 ;
  19.         ffdbolum2 = f2 / f1 ;
  20.  
  21.         printf("b)%f/%f = %f\n",f2,f1,fffbolum2);//iki tane float sayının float sonucu
  22.         printf("  %f/%f = %d\n",f2,f1,ffdbolum2);//iki tane float sayının int sonucu
  23.  
  24.         dddbolum1 = i1 / i2 ;
  25.         ddfbolum1 = i1 / i2 ;
  26.  
  27.         printf("c)%d/%d = %d\n",i1,i2,dddbolum1);//iki tane int sayının int sonucu
  28.         printf("  %d/%d = %f\n",i1,i2,ddfbolum1);//iki tane int sayının float sonucu
  29.  
  30.         dddbolum2 = i2 / i1 ;
  31.         ddfbolum2 = i2 / i1 ;
  32.  
  33.         printf("d)%d/%d = %d\n",i2,i1,dddbolum2);//iki tane int sayının int sonucu
  34.         printf("  %d/%d = %f\n",i2,i1,ddfbolum2);//iki tane int sayının float sonucu
  35.  
  36.         system("pause");
  37.         return 0;
  38.  
  39.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement