Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void programul_3() {
- int a, b, cmmmc, rest;
- int x, y;
- printf("Introduceti primul numar intreg pozitiv\na = ");
- scanf("%d", &a);
- while (a < 1){
- printf("\nReintroduceti a = ");
- scanf("%d", &a);
- }
- printf("\nIntroduceti cel de-al doilea numar intreg pozitiv\nb = ");
- scanf("%d", &b);
- while (b < 1){
- printf("\nReintroduceti b = ");
- scanf("%d", &b);
- }
- x = a;
- y = b;
- while (b != 0){
- rest = a % b;
- a = b;
- b = rest;
- }
- printf("\nCmmdc = %d ", a);
- cmmmc = (x*y) / a;
- printf("\nCmmmc = %d ", cmmmc);
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment