Course Solutions Uncategorized (Solved) : 8 Pts Consider Following C Codes Compute Gcd Two Integers Code 1 Include Int Gcd Int Int B Q30074140 . . . .

(Solved) : 8 Pts Consider Following C Codes Compute Gcd Two Integers Code 1 Include Int Gcd Int Int B Q30074140 . . . .

 

(8 pts) Consider the following C codes to compute the gcd of twointegers.

/// code 1

#include <stdio.h>

int gcd(int a, int b) {

while (a != b) {

if (a > b) a = a – b;

else b = b – a;

    }

    return a;

}      

/// code 2

#include <stdio.h>

int getint() {

    int i;

    scanf(“%d”,&i);

    return i;

}

void putint(int i) {

    printf(“%dn”,i);

}

int main() {

    int i = getint(), j= getint();

while (i != j) {

if (i > j) i = i %j;  

else

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) : Review the websites describing the organizational structures of the Massachusetts AFL-CIO, National Writers’ Union, IUTAM (fol(Answered) : Review the websites describing the organizational structures of the Massachusetts AFL-CIO, National Writers’ Union, IUTAM (fol

Review the websites describing the organizational structures of the Massachusetts AFL-CIO, National Writers’ Union, IUTAM (follow the instructions described in Resources above), and the National Alliance of Postal and Federal