🔒 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
  • 281
    Views
  • 2
    Participants
Last reply from:
dee-u

Online now

Members online
962
Guests online
1,198
Total visitors
2,160

Forum statistics

Threads
2,276,186
Posts
28,968,141
Members
1,231,156
Latest member
zaiyee777
Back
Top