Advertisement
Xioth

C - TP1 - log2.c

Jan 17th, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     double log2 = 1.44269504088896340736;
  7.     int userInput = 0;
  8.  
  9.     printf("Entrez un nombre x pour le calcul de log2(x) :\n");
  10.     scanf("%d", &userInput);
  11.  
  12.     printf("log2(%d) = %f", userInput, log(userInput)*log2);
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement