-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path06.c
More file actions
36 lines (29 loc) · 826 Bytes
/
06.c
File metadata and controls
36 lines (29 loc) · 826 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
Prompt the user for a Numerator (top number of a fraction) and a Denominator (bottom number of a fraction). Tell the user whether or not there is a remainder using if control flow.
Example Output
tokyo:~/LearningC/ # ./assignment6
Enter a numerator: 24
Enter a denominator: 8
There is NOT a remainder!#
tokyo:~/LearningC/ # ./assignment6
Enter a numerator: 55
Enter a denominator: 9
There is a remainder!#
*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main(void)
{
int numerator;
int denominator;
printf("Enter a numerator:");
(void)scanf("%d", &numerator);
printf("Enter a denominator:");
(void)scanf("%d", &denominator);
if (!(numerator % denominator))
printf("There is NOT a remainder!#");
else {
printf("There is a remainder!#");
}
return 0;
}