Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //  main.m
  2. //  Grootste Gemene Deler
  3. //
  4. //  Created by Robbe Vandecasteele on 7/02/11.
  5.  
  6. #import <Foundation/Foundation.h>
  7.  
  8. int main (int argc, const char * argv[])
  9. {
  10.  
  11.     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
  12.    
  13.     unsigned int u, v, temp;
  14.    
  15.     NSLog(@"Geef 2 tetn in.");
  16.     scanf("%u%u", &u, &v);
  17.    
  18.     while (v != 0) {
  19.         temp = u % v;
  20.         u = v;
  21.         v = temp;
  22.     }
  23.    
  24.     NSLog(@"De grootste gemene deler is %u", u);
  25.    
  26.     [pool drain];
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement