what is code for call by value and call by reference?
Answer Posted / anilkumar.s
#include<iostream.h>
class call
{int a,b;
void callbyvalue(int x,int y)
{ a=x;
b=y;
int c;
c=a;
a=b;
b=c;
}
void callbyreference(int *x,int *y)
{
a=x;
b=y;
int *t;
t=a;
a=b;
b=t;
}
void display()
{
cout<<" a=" <<a<<" "<<"b="<<b;
}
void main()
{
call o;
o.callbyvalue(10,20)//value can't be swap
o.callbyreference//value can be swaP
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
Why is encapsulation used?
Why is abstraction used?
String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What is polymorphism in oops with example?
Is oop better than procedural?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is the main feature of oop?
can inline function declare in private part of class?
What is abstract class in oops?
Whats is abstraction in oops?
Where You Can Use Interface in your Project
State what is encapsulation and friend function?
What is the difference between abstraction and polymorphism?
Why do we use polymorphism?