Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <windows.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <time.h>
- int main() {
- long int bzahl;
- int kleinsterTeiler = 2, rest = 1;
- printf("Geben sie die Berechungszahl ein:\n");
- scanf("%ld", &bzahl);
- //printf("\n%ld", zahl);
- if (bzahl < 1) {
- return 0;
- }
- else {
- while (rest != 0) {
- rest = bzahl % kleinsterTeiler;
- kleinsterTeiler++;
- }
- kleinsterTeiler--;
- printf("kleinster Teiler: %i\nBerechungszahl: %ld\n", kleinsterTeiler, bzahl = bzahl / kleinsterTeiler);
- }
- _getch();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement