Skip to Main Content
Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
book

Xpress Learning - Computer Fundamentals of Programming an IT by Pearson

by Ashok N. Kamthane, Rohit Khurana
May 2024
Beginner to intermediate content levelBeginner to intermediate
465 pages
16h 14m
English
Pearson India
Content preview from Xpress Learning - Computer Fundamentals of Programming an IT by Pearson
II-222 Programming Concepts
26.  Explain call by value and call by address with programming example of each one.
Ans:  When value is passed in a function, it is known as call by value. Value is changed only inside
the function. The changed value is not reflected in the original value.
For example,
#include<stdio.h>
#include<conio.h>
void swap(int,int);
void main()
{
int a,b;
clrscr();
printf("enter two integer number\n");
scanf("%d%d",&a,&b);
printf(" before calling swap function \n");
printf("a=%d\t b=%d\n",a,b);
swap(a,b);
printf("after calling swap function");
printf("a=%d\tb=%d\n",a,b);
getch( );
}
void swap(int p,int q)
{
int t;
t=p;
p=q;
q=t;
}
Call by reference: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Express Learning - Computer Fundamentals and Programming

Express Learning - Computer Fundamentals and Programming

Ashok Kamthane, ITL ESL
Windows® Internals, Sixth Edition, Part 2

Windows® Internals, Sixth Edition, Part 2

David A. Solomon Mark E. Russinovich and Alex Ionescu

Publisher Resources

ISBN: 9781299954878