<div id="palet">
  <div id="yazimAlani">
    <input type="text" id="metin"/>
  </div>
  <div id="butonlar">
     <button>7</button>
    <button>8</button>
    <button>9</button>
    
    <button>4</button>
    <button>5</button>
    <button>6</button>
    
    <button>1</button>
    <button>2</button>
    <button>3</button>
   
   
    <button>0</button>
    <button id="c">C</button>
    <button id="back">&#8592;</button>
  </div>
   <div id="islemler"> 
      <button>+</button>
      <button>-</button>
      <button>*</button>
      <button>&#47;</button>
    </div>
  <div style="clear:both"/>
       
</div>
#palet{
  width:210px;
  background-color:#a1b1c1;
  padding:10px;
}

#palet button{
  width:40px;
  height:40px;
  margin:5px;
}
#yazimAlani input{
  font-size:20px;
  width:100%;
  padding:5px;
  box-sizing:border-box;
  text-align:right;
}
#butonlar{
  width:160px;
  float:left;
}
#islemler{float:left;width:30px;}
input[type="text"]{
  
}
var eklensin=true;
var islem=null
var sonuc=null;
var sayi=null;
var devam=false;
let islemYap=(a,b,islem)=>{

  switch(islem){     
    case "+": return a+b;
    case "-": return a-b;
    case "*": return a*b;
    case "/": return a/b;
  }
}

$("#islemler > button").click(function(){ 
	if (devam){
		  sayi=parseInt($("#metin").val());
		  if(sonuc!=null){  	
			sonuc=islemYap(sonuc,sayi,islem);	
      $("#metin").val(sonuc);
			sayi=null;
		  } else{
			sonuc=sayi;
		  }
	
	} 
	eklensin=false;
	devam=false;
	islem=$(this).text();
})

$("#back").on("click",function(){  
  let m=$("#metin").val();
  $("#metin").val(m.substr(0,m.length-1));
});

$("#c").on("click",function(){  
  $("#metin").val(null);
  sayi=null;
  islem=null;
  sonuc=null;
  eklensin=true;
});

$("#butonlar > button:not(#c,#back)").on("click",function(){  
  let a=$(this).text();
  let m=$("#metin").val();
  m=(eklensin)?m+a:a;  
  $("#metin").val(m);
  devam=true;
  eklensin=true;
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js