C ile otopark ücreti hesaplayan program

 #include <stdio.h>

#include <stdlib.h>


float ucrethesapi(int zaman);


int main()

{

  int saat,sayac;

  

  for(sayac=1;sayac<=3;sayac++){

     printf("kaldigi saati giriniz:");

     scanf("%d",&saat);

     printf("odenecek para= %.2f\n",ucrethesapi(saat));     

  

}

  

  

  system("PAUSE");

  return 0;

}


float ucrethesapi(int zaman){

   float odenecek;   

   

   if(zaman<=3){

      odenecek=2;

   }

   if(zaman>=3){

      odenecek=2+ 0.5*(zaman-3);         

   }

     

   if(odenecek>=10){

      odenecek=10;

   }

                 

return odenecek;         

      

      

}//ucretHesapi


Yorum Gönder

0 Yorumlar