User Tools

Site Tools


cs509:cpluscplusvoidfunctions_i

See the following code:

#include <iostream>
using namespace std;


void myfunction( int a, int b ) {
    int mysum = a + b;
}


int main ()
{
   int a = 2;
   int b = 3;
   
   cout << "The sum of " << a << " and " << b << " is: " << myfunction( 2, 3 );
   
   return 0;
}

What will be output by the above program?

  • a - The sum of 2 and 3 is: 5
  • b - The sum of 2 and 3 is:
  • c - The sum of 2 and 3 is: myfunction( 2, 3 )
  • d - Nothing

<poll What will be output by the above program? [a]>

  • a
  • b
  • c
  • d

</poll>

cs509/cpluscplusvoidfunctions_i.txt · Last modified: 2013/02/20 19:38 by jchung

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki