Don’t worry, unlock all articles / blogs on PrepInsta by just simply logging in on our website
Notifications Mark All Read
No New notification
June 24, 2019
Here is the program for gcd of two numbers using command line arguments check other sections for TCS on our website.
#include int main(int a,char *b[]) { int num1,num2,min,i,gcd=1; if(a!=3){ printf("Enter two argument\n"); exit(1); } num1=atoi(b[1]); num2=atoi(b[2]); min=(no1<no2)?no1:no2; for(i=1;i<=min;i++) { if((num1%i)==0 && (num2%i)==0) gcd=i; } printf("GCD of two number %d",gcd); return 0; }
Login/Signup to comment
Get Hiring Updates right in your inbox from PrepInsta
Login/Signup to comment