Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- int n = 3,idx=0,i;
- float *input = (float*) malloc(sizeof(float) * n), max = 0;
- for(i = 0; i < n; i++){
- scanf("%f",input+i);
- float x = *(input+i) - (int)*(input+i);
- if(max < x){
- max = x;
- idx = i;
- }
- }
- printf("%f",*(input + idx));
- return 0;
- }
Add Comment
Please, Sign In to add comment