fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int a=12, b=4;
  5. int mcd;
  6. float r;
  7. mcd=b;
  8. do {
  9. r = a/b;
  10. a=b;
  11. b=r;
  12.  
  13. } while (r != 0); //ripeti mentre b>0, condizione
  14. printf ("mcd = %d \n", mcd);
  15. }
  16.  
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
mcd = 4