What's new

Closed Pwede po mag pa tulong sa inyo sa programming?

Status
Not open for further replies.

Osir1s

Forum Veteran
Joined
Jul 12, 2017
Posts
2,365
Reaction
641
Points
716
Write a function declaration and a function definition for a function that takes three arguments, all of type int, and that returns the sum of its three arguments?
 
public int "function name"; //declaration

public int "function name"(int x, int y, int z){ //definition
return x+y+z; //sum of three arguments will return
}
parang ganyan ata yan sa pagkakaalala ko. Modify mo na lang kung anong language gamit mo.
 
public int "function name"; //declaration

public int "function name"(int x, int y, int z){ //definition
return x+y+z; //sum of three arguments will return
}
parang ganyan ata yan sa pagkakaalala ko. Modify mo na lang kung anong language gamit mo.
c++ po ung ginagamit po namin can you help me please?
 
Code:
#include <iostream>
using namespace std;

public int sample(int x, int y, int z);  //function prototype pala tawag dito

main()
{

cout << sample(1,2,3); //yung 1,2,3 yan yung mga inputs

return 0;
}

public int sample(int x, int y, int z){  //function definition
    return x+y+z;
}
 
Last edited:
maraming salamat po!!!
pwede na po iyan. wala po talaga ako masyado alam sa programming.
engineering course ko pero may ganyan kami.
Okay lang. Siguro naman basic lang din papagawain sa inyo ng prof nyo. Sakin hindi ko rin need ng programming pero kasama kasi sa curriculum.
 
Status
Not open for further replies.

Similar threads

Back
Top