C++ examples for Data Type:int
Reads in two integers and determines and prints if the first is a multiple of the second.
#include <iostream> int main(int argc, const char *argv[]) { int num1, num2; std::cout << "Enter two integers: "; std::cin >> num1 >> num2; std::cout << num1 << ((num1 % num2 == 0) ? " is " : " is not ") << "a multiple of " << num2 << std::endl; return 0;/*from w ww . j a v a 2 s . com*/ }