🔒 Closed Pa help naman po please... Needed ko po talaga.

Status
Not open for further replies.

Aiapangit00

Enthusiast
C++ Language po. Write a function max() which is returns the greatest of two numbers. Test the function with a call from main() and complete with suitable printout.
 
Parang ganito lang ts:
C++:
#include <iostream>
using namespace std;

int Max(int a, int b)
{
    if (a > b)
        return a;
    else
        return b;
}

int main()
{
    int a, b, c;
    
    a = 100;
    b = 991;
    
    c = Max(a,b);
    
    cout << "Max: " <<  c << endl; //by dee-u
    
    return 0;
}
 
Status
Not open for further replies.

Similar threads

About this Thread

  • 1
    Replies
  • 284
    Views
  • 2
    Participants
Last reply from:
dee-u

Trending Topics

Online now

Members online
725
Guests online
1,230
Total visitors
1,955

Forum statistics

Threads
2,286,981
Posts
29,041,580
Members
1,216,321
Latest member
laffytaffy
Back
Top