Call by value in C++

March 28, 2019 · Team EasyExamNotes · 1 min read (est.) · 0 comments

Share on WhatsApp
PRINCIPLES OF PROGRAMMING LANGUAGES

PRACT. Write a program in C++ to implement call by  value parameter passing Methods.
#include <iostream>
using namespace std;
void show(int x)
{
    cout<<x<<endl;
}
int main()
{
    int age = 20;
    show(age);
    show(10);
    return 0;
}

Discussion

Ask a question, share your thoughts or report an error.

Sign in to participate in the discussion.

Join the discussion