find gcd iteratively
C
// C program to find HCF of two
// numbers iteratively.
#include <stdio.h>
int hcf(int a, int b)
{
while (a != b) {
if (a > b)
a = a - b;
else
b = b - a;
}
return a;
}
int main()
{
int a = 60, b = 96;
printf("%d\n", hcf(a, b));
return 0;
}
Also in C:
- Title
- c print array
- Category
- C
- Title
- heitai bestial
- Category
- C
- Title
- strtoul C
- Category
- C
- Title
- fibonacci series using recursion
- Category
- C
- Title
- duplicar cadena
- Category
- C
- Title
- matrix c declaration
- Category
- C
- Title
- last element from list javascript
- Category
- C
- Title
- calculate max of three numbers using ternary operator in c
- Category
- C
- Title
- functions in c
- Category
- C
- Title
- multiplication operator in c
- Category
- C
- Title
- arduino millis()
- Category
- C
- Title
- find gcd iteratively
- Category
- C
- Title
- mangoosejs
- Category
- C
- Title
- malloc in c
- Category
- C
- Title
- error: dereferencing pointer to incomplete type
- Category
- C
- Title
- scanf integer
- Category
- C
- Title
- hostbuilder add environment variables
- Category
- C
- Title
- read a document in c getting name from console
- Category
- C
- Title
- maximo comun divisor
- Category
- C
- Title
- 'int' is not a subtype of type 'double' dart
- Category
- C
- Title
- c fill 2d array
- Category
- C
- Title
- first person view unity
- Category
- C
- Title
- Declare macro
- Category
- C
- Title
- tmux how to kill all sessions
- Category
- C
- Title
- a enum data type in c with loop
- Category
- C
- Title
- putting value of struct in runtme
- Category
- C
- Title
- c concatenate strings
- Category
- C
- Title
- matplotlib pyplot legend location
- Category
- C
- Title
- how to comment in arduino
- Category
- C
- Title
- what is x:Name Xamarin forms
- Category
- C
- Title
- c
- Category
- C
- Title
- remove an element from a set
- Category
- C
- Title
- declare character array statically?
- Category
- C
- Title
- struct in C
- Category
- C
- Title
- convert string to float c
- Category
- C
- Title
- suma de n numeros recursiva
- Category
- C
- Title
- multiplicacion recursiva
- Category
- C
- Title
- left me on read
- Category
- C
- Title
- ModuleNotFoundError: No module named 'easydict'
- Category
- C
- Title
- FILE*
- Category
- C
- Title
- pi in c language
- Category
- C
- Title
- c how to define a variable
- Category
- C
- Title
- how to store a user input with spaces in c
- Category
- C
- Title
- how to print the address of a pointer in c
- Category
- C
- Title
- casting in c
- Category
- C
- Title
- how to use ? in c
- Category
- C
- Title
- where is my vimrc
- Category
- C
- Title
- arduino define
- Category
- C
- Title
- how to check the size of a file c
- Category
- C
- Title
- disable gnu++11 option
- Category
- C
- Title
- accessing elements 2D array using pointers
- Category
- C
- Title
- passing 2d array as parameter to function in c
- Category
- C
- Title
- -> operator
- Category
- C
- Title
- factorial of a given number in c
- Category
- C
- Title
- vbl share price
- Category
- C
- Title
- allocate memory c
- Category
- C
- Title
- version of libgcc
- Category
- C
- Title
- double return type in c
- Category
- C
- Title
- c check if char is an operator
- Category
- C
- Title
- pasar a binario recursivo
- Category
- C
- Title
- c value set to zero __memmove_avx_unaligned_erms
- Category
- C
- Title
- how to put quotes inside string c
- Category
- C
- Title
- ‘uint64_t’ was not declared in this scope
- Category
- C
- Title
- vector aleatorio sin repetir
- Category
- C
- Title
- stack implementation
- Category
- C
- Title
- root in C
- Category
- C
- Title
- variadic function in c
- Category
- C
- Title
- c float to int
- Category
- C
- Title
- múltiplos entre dos numeros en c
- Category
- C
- Title
- what is restrict keyword in c
- Category
- C
- Title
- code wars responsable drinker
- Category
- C
- Title
- what is conio.h
- Category
- C
- Title
- objective c swizzle method
- Category
- C
- Title
- how to download file in powershell
- Category
- C
- Title
- sum of arrays
- Category
- C
- Title
- c check if array is empty
- Category
- C
- Title
- pangram program in c
- Category
- C
- Title
- Difference between ** and *
- Category
- C
- Title
- change a attribute in dataframe
- Category
- C
- Title
- write a binary file c
- Category
- C
- Title
- how to use a pointer as a parameter in c
- Category
- C
- Title
- CL/cl.h: No such file or directory
- Category
- C
- Title
- matplotlib plot circle marker
- Category
- C
- Title
- c string concatenation with int
- Category
- C
- Title
- print integer to stdout using write or putchar?
- Category
- C
- Title
- How to make a printf in c
- Category
- C
- Title
- c array
- Category
- C
- Title
- what is a long long int in c
- Category
- C
- Title
- .\main.c:4:8: error: expected declaration specifiers or '...' before '\x6f726c64'
- Category
- C
- Title
- string to int c
- Category
- C
- Title
- strrev in c
- Category
- C
- Title
- how to call the tkinter insert command from another class
- Category
- C
- Title
- arduino digital io pins
- Category
- C
- Title
- c radians
- Category
- C
- Title
- how to create an array of char in c++
- Category
- C
- Title
- fgets c
- Category
- C
- Title
- networkx remove attributes
- Category
- C
- Title
- how to free a 2d array correctly
- Category
- C
- Title
- linux directory commands
- Category
- C
- Title
- router solicitation and advertisement magic is used by
- Category
- C