Example 2. Coding in C/C++ from Pascal
wprogram gcd_lcm(input, output);
w
w(*This program inputs a specified number of pairs of integers, and for each prints the gcd and/or lcm as specified by the user. *)
w
wvar
w noPairs: integer;
w choice: char;
w oneA, oneB: integer;
w i: integer;
/*This program inputs a specified number of pairs of integers, and for each prints the gcd and/or lcm as specified by the user. */
#include <iostream.h>
int noPairs;
char choice;
int oneA, oneB;
int i;