.
Home About-us Privacy Policy Contact-us Services

Thursday, October 8, 2015

C++ program to multiply and add two values to the inline function

ad+1

Program - 

#include<iostream.h>
#include<conio.h>
inline float mul(float x,float y)
{
return(x*y);
}
inline float add(float p,float q)
{
return(p+q);
}
void main()
{
clrscr();
float a=12.2;
float b= 1.2;
cout<<"\n mul="<<mul(a,b);
cout<<"\n add="<<add(a,b);
getch();
}

Output :
 
 mul=14.64
 add=13.4

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