17. Program that calculates the arc of length of a convex lens by taking radius of arc and angle made by arc.

Chapter 4: 

Input And Output

Programming Exercise

Problem # 17:

Write a program that calculates the arc of length of a convex lens by taking radius of arc and angle made by arc. (Formula: length = radius * angle)

Solution:

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
    float length, radius, angle;
    cout<<"Enter radius of arc : ";
    cin>>radius;
    cout<<"Enter angle of arc : ";
    cin>>angle;
    length = radius * angle;
    cout<<"Length of arc : "<<length<<endl;
    return 0;
}

Let me know in the comment section if you have any question.

Previous Post:
16. Program to swap the values of three variables with using fourth variable.

Comments