LOVEGUN

PPCM Finder (Exercice 13 ISI)

Oct 10th, 2021 (edited)
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.     int a,b,i;
  7.     do{
  8.         printf ("Saisir A: ");
  9.         scanf ("%d",&a);
  10.         printf ("\nSaisir B: ");
  11.         scanf ("%d",&b);
  12.     }while (a<=0 || b<=0 || a<=b);
  13.     i=1;
  14.     do{
  15.         i++;
  16.     }while (i%a!=0 || i%b!=0);
  17.     printf ("Le PPCM est %d",i);
  18. }
  19.  
Add Comment
Please, Sign In to add comment