Facebook
From Bartek, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 278
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     float liczba;
  7.  
  8.     printf("Enter a floating point number:\n");
  9.     scanf("%f",&liczba);
  10.     printf("Ur number is : %f \n",liczba);
  11.     int liczbafloor = liczba;
  12.     int liczbaceiling=liczba+1;  // 5.2   5.8
  13.     float x=liczba-liczbafloor; //= 0.2 v 0.8
  14.     float y=liczba-liczbaceiling; //=-0,8 v -0.2
  15.     if(x<0.5&&y<-0.5)
  16.     {
  17.         printf("Floor is : %d\n",liczbafloor);
  18.  
  19.     } if(x>=0.5&&y>=-0.5)
  20.     {
  21.         printf("ceiling is : %d\n",liczbaceiling);
  22.     }

Replies to podloga sufit rss

Title Name Language When
Re: podloga sufit Bartek c 5 Years ago.