-
Language
C++
-
Description
It asks the user for two numbers, and it says whether the first is a multiple of the second.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifdef __MSDOS__
#include <iostream.h>
#include <stdlib.h>
#else
#include <iostream>
#include <cstdlib>
using namespace std;
#endif
int main (void)
{
int a, b;
cout << "Enter the value of a: ";
cin >> a;
cin.get();
cout << "Enter the value of b: ";
cin >> b;
cin.get();
if(b%a==0)
cout << "The first number is a multiple of the second one." << endl;
else
cout << "The first number is not a multiple of the second one." << endl;
cout << endl;
system ("pause");
return EXIT_SUCCESS;
}
#include <iostream.h>
#include <stdlib.h>
#else
#include <iostream>
#include <cstdlib>
using namespace std;
#endif
int main (void)
{
int a, b;
cout << "Enter the value of a: ";
cin >> a;
cin.get();
cout << "Enter the value of b: ";
cin >> b;
cin.get();
if(b%a==0)
cout << "The first number is a multiple of the second one." << endl;
else
cout << "The first number is not a multiple of the second one." << endl;
cout << endl;
system ("pause");
return EXIT_SUCCESS;
}