You are on page 1of 1

Convert kilometer to meter Convert inches to centimeter

#include <stdio.h> #include <stdio.h>

int int

main (void) main (void)

{ {

int km,m; float i,cm;

printf("enter the distance in km: "); printf("enter the distance in inches: ");

scanf("%d" ,&km); scanf("%f" ,&i);

m=km*1000; cm=i*2.54;

printf("the equivalent distance in m: %d" ,m); printf("the equivalent distance in centimeter: %.2f" ,cm);

return (0); return (0);

} }

Area of triangle

#include <stdio.h>

int

main (void)

int b,h,A;

printf("enter the base: ");

scanf("%d" ,&b);

printf("enter the height: ");

scanf("%d" ,&h);

A=(b*h)/2;

printf("the area of the triangle is: %d" ,A);

return (0);

You might also like