Calculator by React
index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import {add, subtract, multiplication, divide} from './Owngreet'
ReactDOM.render(
<>
<ul>
<li>The Sum of the two digit is : {add(6,4)} </li>
<li>The Subtraction of the two digit is : {subtract(6,4)} </li>
<li>The Multiplication of the two digit is : {multiplication(6,4)} </li>
<li>The Divide of the two digit is : {divide(6,4)} </li>
</ul>
</>
,
document.getElementById('root'));
Calculator.js
function add(a,b)
{
return a+b;
}
function subtract(a,b)
{
return a-b;
}
function multiplication(a,b)
{
return a*b;
}
function divide(a,b)
{
return a/b;
}
export {add,subtract,multiplication,divide};
Comments
Post a Comment