This code defines five functions sum(), diff(), pro(), divi(), and mod() to perform arithmetic operations on two integers. The sum() function returns the sum of two integers, the diff() function returns the difference between two integers, the pro() function returns the product of two integers, the divi() function returns the integer division of two integers, and the mod() function returns the remainder after division of two integers. The main function calls all these functions and displays the results of the arithmetic operations.
#include<iostream> using namespace std; int sum(int num1, int num2) { int num3=num1+num2; return num3; } int diff(int num1, int num2) { int num3=num1-num2; return num3; } int pro(int num1, int num2) { int num3=num2*num1; return num3; } int divi(int num1, int num2) { int num3=num2/num1; return num3; } int mod(int num1, int num2) { int num3=num2%num1; return num3; } int main() { cout<<"\nAddition :"<<sum(10,2); cout<<"\nSubtraction :"<<diff(10,2); cout<<"\nMultiplication :"<<pro(10,2); cout<<"\nDivision :"<<divi(10,2); cout<<"\nModulo division :"<<mod(10,2); return 0; }To download raw file Click Here
Addition :12 Subtraction :8 Multiplication :20 Division :0 Modulo division :2
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions