Please login

Prime

Prepinsta Prime

Video courses for company/skill based Preparation

(Check all courses)
Get Prime Video
Prime

Prepinsta Prime

Purchase mock tests for company/skill building

(Check all mocks)
Get Prime mock

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

}