C++ Program to Find Smallest Number using Call by Value
Code:
Sample Output:
Comment bellow for your Query and Feedback
Code:
/*C++ Program to Find Smallest Number using Call by Value*/
#include<iostream.h>
#include<conio.h>
int compare(int a,int b)
{
return((a<b)?a:b);
}
void main()
{
clrscr();
cout<< "smallest num is:" << compare(1,10) << endl;
cout<< "smallest num is:" << compare(20,10) << endl;
cout<< "smallest num is:" << compare(5,7) << endl;
getch();
}
#include<iostream.h>
#include<conio.h>
int compare(int a,int b)
{
return((a<b)?a:b);
}
void main()
{
clrscr();
cout<< "smallest num is:" << compare(1,10) << endl;
cout<< "smallest num is:" << compare(20,10) << endl;
cout<< "smallest num is:" << compare(5,7) << endl;
getch();
}
Sample Output:
Comment bellow for your Query and Feedback
0 comments:
Confused? Feel free to ask
Post a Comment