OpenStudy (anonymous):

Is there any difference between subprogram, functions , methods , subroutines and procedures in C/C++? Kindly explain with examples

5 years ago
OpenStudy (anonymous):

I am pretty sure that 'subprogram', 'function' and 'method' have all the same meaning in C/C++ but we usually called them functions, and we divide the functions into two types : Function : it's the usual one, as we all know, it returns a value. General format : Type function_name(<arguments>){ // Your work return <value/variable> //Note : the type must be the same as the function // type. } Example : int Maheen(int a, int b){ int c = a + b; return c; } Procedure : it's a function but it doesn't return any value, it begins with 'void'. General format : void function_name(<arguments>){ // Your work //Note : There is no return here. } Example : void Maheen(int a, int b){ int c = a + b; printf("The sum is : %d", c); } Now for the subroutine, I am not sure about this one, but I really would consider it the same as the others. Good luck.

5 years ago
OpenStudy (rsmith6559):

method is actully a term from java. In.C++, they're called member functions.

5 years ago
OpenStudy (anonymous):

mr. ktobah thanx 4 ur concern but i need more examples , as i was searching abt it on my own and found that all are same things just the difference of names , m stil confuse y all research results r saying this ???

5 years ago
OpenStudy (anonymous):

mr.rsmit6559 as i knw the term method is also used in c/c++. and the term member functions is also used in c++ .

5 years ago
OpenStudy (anonymous):

Yes they are all the same, and all means they are a part of code from the global program, it's just a literature matter. I mean just many words that mean the same thing or maybe with a little bit difference.

5 years ago
OpenStudy (anonymous):

thanx

5 years ago
OpenStudy (anonymous):

You're welcome.

5 years ago
Similar Questions: