Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. int input();
  9. int findmax(int a, int b);
  10. int findmin(int a, int b);
  11. int output(int minvalue, int maxvalue);
  12. int main()
  13. {
  14. /*int num1 = 54, num2 = 67, num3 = 87, num4 = 34, num5 = 21;
  15. int num6 = 78, num7 = 66, num8 = 88, num9 = 33;*/
  16.  
  17.  
  18. int num1, num2, max, min;
  19.  
  20. input();
  21.  
  22. cout << "Please enter the first number" << endl;
  23. cin >> num1;
  24. cout << "Please enter the second number" << endl;
  25. cin >> num2;
  26. max = findmax(num1, num2);
  27. min = findmin(num1, num2);
  28. output(max, min);
  29.  
  30. return 0;
  31. }
  32.  
  33. int input()
  34. {
  35.  
  36. cout << "Accepted list of numbers are 54, 67, 87, 34, 21, 78, 66, 88, and 33." << endl;
  37. return 0;
  38.  
  39. }
  40.  
  41. int findmax(int a, int b)
  42. {
  43. if (a < b)
  44. cout << b << endl;
  45. else
  46. cout << a << endl;
  47. return 0;
  48. }
  49.  
  50. int findmin(int a, int b)
  51. {
  52. if (a > b)
  53. cout << b << endl;
  54. else
  55. cout << a << endl;
  56. return 0;
  57. }
  58.  
  59. int output(int minvalue, int maxvalue)
  60. {
  61. cout << "Maximum value is" << maxvalue << endl;
  62. cout << "Manimum value is" << minvalue << endl;
  63. return 0;
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement