Home Basic Loop Array string Function Pointer Contact STUDY

AHF    C    PROGRAM    SOLVING

Programming tips

" ; " after loop



Header file



Specifer



Working with switch case



Comment




Calculate area of a triangle



// AHF C PROGRAM SOLVING

//solving here basic type of programming problem

#include<stdio.h> #include<math.h> #define pf printf int main() { float a,b,res=0.0; pf("Enter the first length: "); scanf("%f",&a); pf("\nEnter the second length: "); scanf("%f",&b); res=.5*a*b; pf("\nThe area of the triangle is = %f",res); return 0; }
OUTPUT:


© 2018 - All rights reserved