Advertisement
LivioBrunner

Schaltjahrproblematik - M403

Dec 8th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.34 KB | None | 0 0
  1. /*******************************************************************************
  2. * Programm:                                                                      
  3. * Filename:   Schaltjahrproiblematik.c
  4. *                                                  
  5. * Autor:      Livio Brunner                                                                            
  6. * Version:    1.0                                                                                                  
  7. * Datum:      8.12.2014
  8. *
  9. * Entwicklungsablauf(Version, Datum, Autor, Entwicklungsschritt, Zeit):
  10. * 1.0, 8.12.14, Brunner Livio, Intialisierung des Projekts, 25min
  11. *                                                         Totalzeit:                                                               
  12. ********************************************************************************
  13. *
  14. * Verwendungszweck: C-Schulung, M403, M419
  15. *
  16. * Beschreibung:
  17. *    
  18. *
  19. * Precondition:  -
  20. *
  21. * Postcondition: -
  22. *
  23. * Benötigte Libraries:
  24. * - stdlib.h
  25. * - stdio.h
  26. *
  27. * Copyright (c) 2014 by L.Brunner, CH-6312 Steinhausen
  28. *******************************************************************************/
  29.  
  30. /***  Include Files ***********************************************************/
  31. #include <stdlib.h> /* Funktionsbibliothek: Hilfsfunktionen */
  32. #include <stdio.h>  /* Funktionsbibliothek: Standard Ein- Ausgabe */
  33.  
  34. /***  Globale Deklarationen und Definitionen **********************************/
  35.  
  36.  
  37. /***  Funktions-Deklarationen *************************************************/
  38.                                                                
  39.  
  40.  
  41. /*******************************************************************************
  42. ******************************* HAUPTPROGRAMM **********************************
  43. *******************************************************************************/
  44. int main(void) {
  45.    
  46.   // lokale Variablen
  47.                                                              
  48.  
  49.  
  50.   /* Intro --------------------- */
  51.   int Eingabe;
  52.   /* Eingabe ------------------- */
  53.  
  54.  
  55.   /* Verarbeitung und Ausgabe -------------- */
  56.   do{
  57.     printf("Jahreszahl:");
  58.     scanf("%d", &Eingabe);
  59.     if(((Eingabe % 400) == 0) || ((Eingabe % 4) == 0 && (Eingabe % 100) != 0)){
  60.         printf("%d ist ein Schaltjahr\n", Eingabe);
  61.     } else {
  62.         printf("%d ist kein Schaltjahr\n", Eingabe);
  63.     }
  64.   }while(Eingabe<9999);
  65.  
  66.   /* Ausgabe ------------------- */      
  67.  
  68.   system ("PAUSE"); /* Nur während der Entwicklungsphase, später löschen! */
  69.   return (0);
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement