Advertisement
Guest User

Untitled

a guest
Nov 29th, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <windows.h>
  3. #include <conio.h>
  4. #include <stdlib.h>
  5. #include <time.h>
  6.  
  7. int main() {
  8.     long int bzahl;
  9.     int kleinsterTeiler = 2, rest = 1;
  10.     printf("Geben sie die Berechungszahl ein:\n");
  11.     scanf("%ld", &bzahl);
  12.     //printf("\n%ld", zahl);
  13.     if (bzahl < 1) {
  14.         return 0;
  15.     }
  16.     else {
  17.         while (rest != 0) {
  18.             rest = bzahl % kleinsterTeiler;
  19.             kleinsterTeiler++;
  20.         }
  21.         kleinsterTeiler--;
  22.         printf("kleinster Teiler: %i\nBerechungszahl: %ld\n", kleinsterTeiler, bzahl = bzahl / kleinsterTeiler);
  23.     }
  24.     _getch();
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement