diff --git a/C++/mathematicaloperators.cpp b/C++/mathematicaloperators.cpp new file mode 100644 index 0000000..a87dc3f --- /dev/null +++ b/C++/mathematicaloperators.cpp @@ -0,0 +1,15 @@ +#include +using namespace std; +int main() +{ +int a,b; +cin>>a>>b; //input of two numbers +cout< +int main() +{ +int a,b; +scanf("%d%d",a,b); //input of two numbers +printf("%d\n",a+b); //sum of two numbers +print("%d\n",a-b); //difference of two numbers +printf("%d\n",a%b); //modulo i.e. remainder of division of two numbers +printf("%d\n",a/b); //type casting of division by int +printf("%d\n",a*b); //multiplication of two nos. +return 0; +} + diff --git a/python/mathematicaloperators.py b/python/mathematicaloperators.py new file mode 100644 index 0000000..514ae90 --- /dev/null +++ b/python/mathematicaloperators.py @@ -0,0 +1,11 @@ +#this file contains some of the very basic mathematical calculations +a=int(input()) #input numbers +b=int(input()) +print(a+b) #add two nos +print(a-b) #subtract two nos +print(a**b) #raise 5 to the power two +print(a//b) #5 divide by 2 with integer typecasting +print(a*b) #multiply of 2 nos. +print(a/b) #division of two nos with float typecasting +print(a%b) #remainder of two nos. division +