GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

No menu could be recovered. Follow the blue links in the page.

This view

  • Original page
  • New address

GeezerVison is showing tr.javascript.info — Kullanıcının girdiği değerleri toplayan program

  • Eğitim
  • JavaScript Dili
  • Veri Tipleri
  • Sayılar
Derse geri dön

Kullanıcının girdiği değerleri toplayan program

önem: 5

Kullanıcıya iki defa değer soran ve bu değerleri toplayan kodu yazınız.

Demoyu çalıştır

P.S. Tiplerle ilgili bir numara var.

let a = +prompt("İlk numara", "");
let b = +prompt("İkinci numara?", "");

alert( a + b );

prompt öncesi koyulan + işareti alınan değeri doğrudan sayıya çevirir.

Diğer türlü girilen değerler string olarak algılanır toplama yerine birleştirilir: "1" + "2" = "12"

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.