© 2014 Firstsoft Technologies (P) Limited. login
Hi 'Guest'
Home SiteMap Contact Us Disclaimer
enggedu
Quick Links
Easy Studies

Home Lab Exercise Object Oriented Programming Lab Exercise ProgramsCPP Program For Call By Reference▼


CPP Program For Call By Reference

Alogarithm steps:

  1. Start the program
  2. Write the function and pass the address of one value through that function
  3. Assign the address to pointer
  4. Perform the multiplication operation
  5. Compile and execute the program.

CPP Program For Call By Reference

#include #include void multi(int &a) { int a,b,c; int *q = &p; cout<<”Enter the b value:” cin>>b; c=q*b; cout<<”Multiplication of a and b is: “<>a; muti(&a); return 0; }

SAMPLE INPUT AND OUTPUT:

a: 34

Enter the b value: 23

Multiplication of a & b is: 782

 

 
SLogix Student Projects

⇓Student Projects⇓
⇑Student Projects⇑
bottom