pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/seeditsolution/cprogram/commit/e4ec876138c376b1695fa57fb4b5fbe4831297c8

/> Create Gcdrecursion.cpp · seeditsolution/cprogram@e4ec876 · GitHub
Skip to content

Commit e4ec876

Browse files
authored
Create Gcdrecursion.cpp
1 parent 6be80a8 commit e4ec876

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Gcdrecursion.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <stdio.h>
2+
int hcf(int n1, int n2);
3+
int main() {
4+
int n1, n2;
5+
printf("Enter two positive integers: ");
6+
scanf("%d %d", &n1, &n2);
7+
printf("G.C.D of %d and %d is %d.", n1, n2, hcf(n1, n2));
8+
return 0;
9+
}
10+
11+
int hcf(int n1, int n2) {
12+
if (n2 != 0)
13+
return hcf(n2, n1 % n2);
14+
else
15+
return n1;
16+
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy