मराठी

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.

Advertisements

प्रश्न

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.

Advertisements

उत्तर

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";
  }
}
shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?

APPEARS IN

Advertisements
Share
Notifications



      Forgot password?
Use app×