What's new

Help Pa help naman po please... Needed ko po talaga.

Aiapangit00

Enthusiast
Joined
Jan 29, 2022
Posts
49
Reaction
7
Points
50
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;
}
 

Similar threads

Back
Top