// C code
// This program will calculate the area of a right triangle.
// Developer: Faculty CMIS102
// Date: Jan 31, XXXX
#include <stdio.h>
int main ()
{
/* variable definition: */
float base, height, area;
/* Prompt user for base */
printf("Enter the base of the triangle: \n"); // Input the base
/* Prompt user for height */
printf("Enter the height of the triangle: \n"); // Input the base
// Calculate the Area
area= 0.5 * (base * height);
// Print the result
printf("Area is : %f\n", area
); return 0;
}
Ly8gQyBjb2RlCi8vIFRoaXMgcHJvZ3JhbSB3aWxsIGNhbGN1bGF0ZSB0aGUgYXJlYSBvZiBhIHJpZ2h0IHRyaWFuZ2xlLgovLyBEZXZlbG9wZXI6IEZhY3VsdHkgQ01JUzEwMgovLyBEYXRlOiBKYW4gMzEsIFhYWFgKI2luY2x1ZGUgPHN0ZGlvLmg+CmludCBtYWluICgpCnsKLyogdmFyaWFibGUgZGVmaW5pdGlvbjogKi8KZmxvYXQgYmFzZSwgaGVpZ2h0LCBhcmVhOwovKiBQcm9tcHQgdXNlciBmb3IgYmFzZSAqLwpwcmludGYoIkVudGVyIHRoZSBiYXNlIG9mIHRoZSB0cmlhbmdsZTogXG4iKTsKLy8gSW5wdXQgdGhlIGJhc2UKc2NhbmYoIjEwLjFmIiwgJmJhc2UpOwovKiBQcm9tcHQgdXNlciBmb3IgaGVpZ2h0ICovCnByaW50ZigiRW50ZXIgdGhlIGhlaWdodCBvZiB0aGUgdHJpYW5nbGU6IFxuIik7Ci8vIElucHV0IHRoZSBiYXNlCnNjYW5mKCIxMi4yZiIsICZoZWlnaHQpOwovLyBDYWxjdWxhdGUgdGhlIEFyZWEKYXJlYT0gMC41ICogKGJhc2UgKiBoZWlnaHQpOwovLyBQcmludCB0aGUgcmVzdWx0CnByaW50ZigiQXJlYSBpcyA6ICVmXG4iLCBhcmVhKTsKcmV0dXJuIDA7Cn0K