C++
/*
lab No 11
Deign a c++ application that will recive two in intger value from the
user(a and,b), the application is to determine and state wheather or
not a is evenly divisible by b.
Date: Feb 19 2014
*/
#include <iostream>
using namespace std;
//declare of function
void my_input (int *, int *);
void my_verify (int *, int *);
void main (void)
{
int n1 = 0, n2=0;
my_input (&n1, &n2);
my_verify (&n1, &n2);
char x1;
cin>>x1;
}
void my_input (int *f1, int *f2)
{
cout<< " Please provide me with an integer value (a) "<< endl;
cout<< " Please provide me with an integer value (b) "<< endl;
cout<< " This application will determin if the number is evenly divisible by (b) ."<<endl;
cin>> *f1;
cin>> *f2;
}
void my_verify (int *f3, int *f4)
{
if (*f3 % *f4)
{
cout<< "The number "<<*f3<<" is not evenly divisibale by "<<*f4<< endl;
}
else
{
cout<< "The number "<<*f3<<" is evenly divisibale by "<<*f4<< endl;
}
}
Typicaly output
/*
Please provide me with an integer value (a)
Please provide me with an integer value (b)
This application will determin if the number is evenly divisible by (b) .
3
4
The number 3 is not evenly divisibale by 4
*/