21 lines
		
	
	
		
			491 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			491 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include <stdio.h>
 | |
| #include <stdlib.h>
 | |
| #include <math.h>
 | |
| 
 | |
| int main(int argc, char *argv[]) {
 | |
|     if (argc != 2) {
 | |
|         printf("Usage: %s <valeur réelle>\n", argv[0]);
 | |
|         return 1;
 | |
|     }
 | |
| 
 | |
|     double valeur = atof(argv[1]); // Convertit l'argument en double
 | |
|     double partie_entiere, partie_decimale;
 | |
| 
 | |
|     partie_decimale = modf(valeur, &partie_entiere);
 | |
| 
 | |
|     printf("partie entière : %f\n", partie_entiere);
 | |
|     printf("partie décimale : %f\n", partie_decimale);
 | |
| 
 | |
|     return 0;
 | |
| }
 |