[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.

Program Discussion :: Basics

Home > Programs > Basics

314 / 279

Write a program using command line arguments to input two number and find the GCD/HCF of the number.

Condition:
If the entered number is less than 2 print the message and exit.

Answer:

#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

Asked In :: TCS

Post Your Answer Here:

Language:

Post Your Reply Here:



Language:

Post Your Reply Here:



Language:

Post Your Reply Here: