Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Taschenrechner einfach

Empfohlene Antworten

Veröffentlicht

Moin,

habe folgendes Problem. Haben in der Schule was geschrieben und ich wollte es daheim nochmal nachscheiben.

Allerdings geht es jetzt nicht. Habe mehrere Probleme. Wer kann helfen?

#include <stdio.h>

#include <stdlib.h>

int main(int argc, char *argv[])

{

float fzahl1, fzahl2;

int iwahl;

fzahl1=0;

fzahl2=0;

iwahl=0;

printf ("Willkommen beim Rechner fuer Noobs \n");

printf ("Bitte druecke 1 fuer Addition \n");

printf ("Bitte drücke 2 für Subtraktion \n");

printf ("Bitte drücke 3 für Dividieren \n");

printf ("Bitte drücke 4 für Multiplikation \n");

scanf ("%i", iwahl);

switch(iwahl)

{

case 1:

printf ("Bitte gib die erste Zahl an \n");

scanf ("%f", fzahl1);

printf ("Bitte gib die zweite Zahl an \n");

scanf("%f", fzahl2);

printf ("Das Ergebnis ist %f \n"), fzahl1+fzahl2;

break;

case 2:

printf ("Bitte gib die erste Zahl an \n");

scanf ("%.2f", fzahl1);

printf ("Bitte gib die zweite Zahl an \n");

scanf("%.2f", fzahl2);

printf ("Das Ergebnis ist %.2f \n"), fzahl1-fzahl2;

break;

case 3:

printf ("Bitte gib die erste Zahl an \n");

scanf ("%.2f", fzahl1);

printf ("Bitte gib die zweite Zahl an \n");

scanf("%.2f", fzahl2);

printf ("Das Ergebnis ist %.2f \n"), fzahl1/fzahl2;

break;

case 4:

printf ("Bitte gib die erste Zahl an \n");

scanf ("%.2f", fzahl1);

printf ("Bitte gib die zweite Zahl an \n");

scanf("%.2f", fzahl2);

printf ("Das Ergebnis ist %.2f \n"), fzahl1*fzahl2;

break;

default:

printf ("Bitte eine richtige Eingabe machen \n");

break;

}

system("PAUSE");

return 0;

}

Also ich denke das unter der Auswahl das scanf falsch ist. aber ich hab voll den blackout.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.