1.

Write the code for the program in c language using command line arguments.the program given to me is area of a triangle.

Answer»

#include

Void MAIN(int argc, CHAR *argv[])

{

int base, height

float=area;

/*argv[0] contains name of the program itself*/

base=atol(argv[1]);//function for converting ASCII to LONG

height=atol(argv[2]);

area=base*height/2;

printf("%f",area) ;

}



Discussion

No Comment Found