Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Project: uebung17a_zahlen_teilbarkeit
- Author: Maid Fazlic
- Date: 14.10.2019
- */
- 'use strict';
- const appName = 'zahlen_teilbarkeit';
- document.getElementById('myTitle').innerText = appName;
- document.getElementById('myHeading1').innerText = appName;
- const output = document.getElementById('output');
- //variable gets his value
- let Zahl = 1;
- //loop repeats until condition si true
- while (Zahl != 100) {
- if (Zahl%3 == 0) {
- document.write("<p> durch drei teilbar </p>");
- } else if (Zahl%5 == 0) {
- document.write("<p> durch fünf teilbar </p>");
- } else if (Zahl%3 == 0 && Zahl%5 == 0) {
- document.write("<p> durch drei und fünf teilbar </p>");
- } else {
- document.write("<p>"+ Zahl +" </p>");
- }
- Zahl++;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement