Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
OOP
//g++ 7.4.0 #include <iostream> using namepscae std; int main() { // Function prototype // type function-name (arguments); // int sum(int a, int b); //--> Acceptable // int sum(int a, b); //--> Not Acceptable int sum(int, int); //--> Acceptable // void g(void); //--> Acceptable void g(); //--> Acceptable int main(){ int num1, num2; cout<<"Enter first number"<<endl; cin>>num1; cout<<"Enter second number"<<endl; cin>>num2; // num1 and num2 are actual parameters cout<<"The sum is "<<sum(num1, num2); g(); return 0; } int sum(int a, int b){ // Formal Parameters a and b will be taking values from actual parameters num1 and num2. int c = a+b; return c; } void g(){ cout<<"\nHello, Good Morning"; } //cout << ""<<endl; }
run
|
edit
|
history
|
help
0
Two-phase sample with GCC
c++_array_size
C++ Car Racing game framework 2
Default_Template
19 მარტს დამუშავებული
Namespace
Split in C++ (Simple)
infections.cpp
Mirror a binary tree
Matrix rotation