Command Line Program to find Area of Traingle

C Programming Language / Command Line Arguments

549

Program:

#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);

}

Output:

2  3 

3.000000

Explanation:

Nope

This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.