Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- void getInt(int *number);
- void compareInt(int num1, int num2, int *larger);
- void displayInt(int result);
- int main(int argc, char const *argv[])
- {
- int input1, input2;
- int result;
- getInt(&input1);
- getInt(&input2);
- compareInt(input1, input2, &result);
- displayInt(result);
- return 0;
- }
- void getInt(int *number)
- {
- scanf("%d", number);
- }
- void compareInt(int num1, int num2, int *larger)
- {
- if(num1 > num2)
- {
- *larger = num1;
- }
- else
- {
- *larger = num2;
- }
- }
- void displayInt(int result)
- {
- printf("%d is the larger integer", result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement