.
Home About-us Privacy Policy Contact-us Services

Thursday, October 8, 2015

C++ Program to multiply two number by using the pointer to function

ad+1

Program -


#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int mul(int,int),(*p1)(int,int),x,y,z;
cout<<"\n enter the value of x & y:"<<endl;
cin>>x>>y;
p1=&mul;
z=(*p1)(x,y);
cout<<"\n final value is:"<<z;
getch();
}
int mul(int a,int b)
{
int m;
m=a*b;
return(m);
}
 
Output

 enter the value of x & y:
5
2
final value is:10


 

0 comments:

Post a Comment

Home About-us Privacy Policy Contact-us Services
Copyright © 2014 All Programs Examples | All Rights Reserved. Blogger Templates Download Blogger Templates