diogoAlves

IFF/Programação Estruturada/Lista 0/Exercício 5

May 3rd, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.39 KB | None | 0 0
  1. //IFF - Programação Estruturada
  2. //Lista de Exercícios 0 - Exercício 5
  3. #include<stdio.h>
  4.  
  5. float dividirNumero(float n){
  6.     do{
  7.         n=n/2;
  8.     }while(n>1);
  9.     return n;
  10. }
  11.  
  12. int main(){
  13.     setbuf(stdout,NULL);
  14.     float n=0;
  15.     printf("Entre com um valor: ");
  16.     scanf("%f",&n);
  17.     printf("O resultado da ultima divisão, que retornou um valor menor ou igual a 1, foi: %.2f",dividirNumero(n));
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment