Command Line Program to find Area of Traingle

It is highly advisable to go through Command Line Arguments Post before even looking at the code. Please study this for TCS and come back to this post later.

#include <stdio.h>

int main(int argc, char *argv[])

{

             int base, height;

            float area;

             base = atol(argv[1]);

            height = atol(argv[2]);

            area = base*height/2;

            printf("%f",area);

}

Please Login/Signup to comment