0

can you explain this while

#include <stdio.h> int main () { int A[10]= {64,56,42,55,58,46,44,64,42,46}; int B[10]= {72,96,86,72,92,96,84,72,68,82}; int N,m,n,s,X; N = 1; m = A[N]; n = B[N]; if (m<n) {X = m; m=n; n=X; } while (n != 0) {X = m/n; s = m - X * n; m = n; n = s; } printf ("%i", m); }

6th Oct 2022, 3:43 AM
Muhamad Ilham
Muhamad Ilham - avatar
1 Answer
0
If you are asking for a while then I think it's easy, correct me if wrong. While loop Do u know about while? It runs specific code block ex: { printf("hello"); } As long as x = 2 If x changes value it will stop. Here while loop will work as Long as n is not equal to 0, As long as n's value not equal to 0, x's value will be the quotient of the division between m and n S's value will be subtraction X and multiplied by n M will be equal to n And n will be equal to s.
9th Oct 2022, 10:16 AM
Yash Raj
Yash Raj - avatar