Informatiker Board (http://www.informatikerboard.de/board/index.php)
- Themengebiete (http://www.informatikerboard.de/board/board.php?boardid=1)
-- Theoretische Informatik (http://www.informatikerboard.de/board/board.php?boardid=5)
--- switch-Verzweigung (http://www.informatikerboard.de/board/thread.php?threadid=1114)
Zitat: |
#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int b; printf("Gib hier bitte eine Zahl ein : "); scanf("%d", &b); fflush(stdin); switch(b) { case b<=10: int z=b*b; printf("%d\n", z); break; case b>10 && b<=20 : float q=b*b/3; printf("%f\n", q); break; case b>20 : float u=b*b*(b/222)-22; printf("%f\n", u); case Nr>30 : float l=b/5+2.5; printf("%f\n", l); } system("PAUSE"); return 0; } |