Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

c program algorithm to find the set of vertices making a regular 2D polygon

+3 votes
asked Feb 28, 2020 by anonymous

2 Answers

0 votes
answered May 2, 2021 by Han-ma-bookie (360 points)
#include <iostream>

using namespace std;

int main () {

int sides;

cout << "how many sides the polygon has? :" ;

cin >> sides;

cout << "the number of vertices are equal the numbers of sides" << endl;

cout << sides;

return 0;

0 votes
answered May 3, 2021 by Peter Minarik (89,230 points)
Sorry, but this is not specific enough. It's not clear what the program is supposed to do. What are the inputs? What are the outputs? What "set of vertices" need to be found for what polygon. There are infinite number of polygons. Do you want a set of (x, y) coordinates, or (x, y, z) that are in the same plane?

Again, it's really not clear what you're after.

It's also better if you post the problem (the task) description in details then your attempt to solve it (the code you wrote).
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.