FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 78   



Following program shows you how to calculate parallelogram circumference.
This program gets parallelogram base and side from user and calculates circumference and prints it using following formula
Circumference = 2 X base X side

#include <stdio.h>

int main(void) {
    float parallelogramBase;
    float parallelogramSide;

    printf("Please enter base of parallelogram:");
    scanf("%f", &parallelogramBase);

    printf("Please enter side of parallelogram:");
    scanf("%f", &parallelogramSide);

    float circumferenceOfParallelogram =
        2 * (parallelogramBase + parallelogramSide);

    printf(
        "Circumference of parallelogram is: %f", circumferenceOfParallelogram);
}

Output:

Please enter base of parallelogram: 33
Please enter side of parallelogram: 55
Circumference of parallelogram is: 176.000000



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News