Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************************
- * Programm:
- * Filename: Schaltjahrproiblematik.c
- *
- * Autor: Livio Brunner
- * Version: 1.0
- * Datum: 8.12.2014
- *
- * Entwicklungsablauf(Version, Datum, Autor, Entwicklungsschritt, Zeit):
- * 1.0, 8.12.14, Brunner Livio, Intialisierung des Projekts, 25min
- * Totalzeit:
- ********************************************************************************
- *
- * Verwendungszweck: C-Schulung, M403, M419
- *
- * Beschreibung:
- *
- *
- * Precondition: -
- *
- * Postcondition: -
- *
- * Benötigte Libraries:
- * - stdlib.h
- * - stdio.h
- *
- * Copyright (c) 2014 by L.Brunner, CH-6312 Steinhausen
- *******************************************************************************/
- /*** Include Files ***********************************************************/
- #include <stdlib.h> /* Funktionsbibliothek: Hilfsfunktionen */
- #include <stdio.h> /* Funktionsbibliothek: Standard Ein- Ausgabe */
- /*** Globale Deklarationen und Definitionen **********************************/
- /*** Funktions-Deklarationen *************************************************/
- /*******************************************************************************
- ******************************* HAUPTPROGRAMM **********************************
- *******************************************************************************/
- int main(void) {
- // lokale Variablen
- /* Intro --------------------- */
- int Eingabe;
- /* Eingabe ------------------- */
- /* Verarbeitung und Ausgabe -------------- */
- do{
- printf("Jahreszahl:");
- scanf("%d", &Eingabe);
- if(((Eingabe % 400) == 0) || ((Eingabe % 4) == 0 && (Eingabe % 100) != 0)){
- printf("%d ist ein Schaltjahr\n", Eingabe);
- } else {
- printf("%d ist kein Schaltjahr\n", Eingabe);
- }
- }while(Eingabe<9999);
- /* Ausgabe ------------------- */
- system ("PAUSE"); /* Nur während der Entwicklungsphase, später löschen! */
- return (0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement