Advertisement Remove all ads

Write a Program in C++ to Accept Two Integer Values in Main· Function, Pass Them to Function Great() Using Call by Value and Find Greater Number, Function Great() Should Not Return Any Value. - Computer Science 1

Advertisement Remove all ads
Advertisement Remove all ads
Advertisement Remove all ads

Write a program in C++ to accept two integer values in main· function, pass them to function great() using call by value and find greater number, function great() should not return any value.

Advertisement Remove all ads

Solution

void great (int, int);
void main()
{
  int a, b;
  cout <<"Enter two no=";
  cin>> a>>b;
  great(a, b);
  getch();
}
void great (int p, int q)
{
  if (p > q)
  {
    cout << p << " is big";
  }
  else
  {
    cout << q << " is big";
  }
}
Concept: C++ Programming
  Is there an error in this question or solution?

APPEARS IN

Advertisement Remove all ads
Share
Notifications

View all notifications


      Forgot password?
View in app×