Computer Science, asked by vivekkumarraj1986, 3 months ago

The room that Patrick and Johnny were staying>was very big. They felt lazy to walk inside the room>from the bed's location to another location. So>they wanted to change the position of the bed.>The shape of the room is a Square. They decided>to place the bed at the centre of the room so that>their walking distance would be minimised. Can>you please help them in placing the bed at the>centre?​

Answers

Answered by arjunnkarthikeyann
5

Answer:

#include<stdio.h>

int main()

{

int x, y, l;  

printf("Enter the x-coordinate of the left bottom vertex\n");

scanf("%d",&x);

printf("Enter the y-coordinate of the left bottom vertex\n");

scanf("%d",&y);

printf("Enter the length of a side\n");

scanf("%d",&l);

x=x+(l/2);

y=y+(l/2);

printf("The centre of the room is at(%d,%d)",x,y);

}

Explanation:

--good luck--

Answered by raakeshm02
0

This is the answer for this question.

Attachments:
Similar questions