write a program to Add two integers given at command line | Command line Input

Spread the love

/*********** Program ***********/

#include<stdio.h>
main(int argc, char *argv[])
{
     if(argc!=3)
     {
      printf(“use <executable> <int1> <int2> n”);
       return;
     }

      int a,b,c;
      a=atoi(argv[1]);
      b=atoi(argv[2]);

      c=a+b;

      printf(“Sum :%dn”,c);

}

/********* OUTPUT **************/



Venkatesh Macha

Hi Guys, I am Venkatesh Macha. I am a programmer and an Open Source enthusiast, Presently working as a Software Engineer. Apart from that, I love to explore new technologies and things.

You may also like...

Leave a Reply