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

Trending Topics

Online now

Members online
1,135
Guests online
1,867
Total visitors
3,002

Forum statistics

Threads
2,314,910
Posts
29,180,150
Members
1,183,350
Latest member
Magicman444
Back
Top