Take FREE!! Online Mettl Mock Test to Crack TechM and Other Companies Written Exams.
Get Off-Campus Placement Jobs Info !!!
Practice Tech Mahindra Essay Topics

Program Discussion :: Basics

Home > Programs > Basics

314 / 259

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: