Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Student ID: 201368218
- * Student Name: Alexander Dunne
- * Email: a.dunne2@student.liverpool.ac.uk
- *
- * User: sgadunn3
- *
- * Problem ID: 1030
- * RunID:
- * Result: Accepted
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main(int argc, char const *argv[]) {
- //variables
- int a, b, c;
- float answer;
- int result;
- //input
- scanf("%d %d %d", &a, &b, &c);
- //calculation
- answer = (float)a / (float)b; //store a / b in variable answer
- int finalAnswer = (int)(fabsf(answer) * pow(10, 5)) % 10;
- printf("%d", finalAnswer);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement