Hello, I have problems with creating program like this:

Input five pairs of nunbers and input menu:

MENU

-----

1. GCD

2. LCM

0. CLOSE

Input option:

1

Input number of selected pair of numbers:

1

print result and print menu again.

It suppose on input there isn't different number and everything should be realized by custom separated functions.

I created this, but I don't know how to finish it, please could you help me?

Code:#include <stdio.h> #include <stdlib.h> unsigned int nsd(unsigned int m, unsigned int n) { if (n==0) return m; else return nsd(n,m%n); } int lcm(int a,int b) { int n; for(n=1;;n++) { if(n%a == 0 && n%b == 0) return n; } } int menu() { int i; printf("%s\n%s\n%s\n%s\n%s\n%s\n", "MENU", "-----", "1. Nejvetsi spolecny delitel", "2. Nejmensi spolecny nasobek", "0. KONEC", "Zadej operaci:"); i = getchar(); if (i==1) { unsigned int vysledek_nsd, m, n; printf("Zadej m a n"); m = getchar(); n = getchar(); vysledek_nsd = nsd(m, n); printf("%u", vysledek_nsd); } if (i==2) { //nsn(); } if (i==0) return 0; if (i!=0 && i!=1 && i!=2) { printf("%s\n", "Chybne zadani"); return -1; } return 0; } int main(void) { /*int i, j, pole[2][5]; puts("Zadej dvojice cisel: "); for(int x=0; x<5; x++) { scanf("%d%d", &i, &j); for(int c = 0; c<2; c++) { for(int k = 0; k<5; k++) { pole[i][j] = c; } } } for(int c = 0; c<2; c++) { for(int d = 0; d<5; d++) { pole[c][c]++; printf("Nejake cislo: %d a druhe cislo %d\n", i, j); } } */ int vysledek = menu(); if(vysledek == -1) return -1; return EXIT_SUCCESS; }