lab_structures_pointers
lab_structures_pointers
1- Write a C program that reads an array of integers then searches and displays the max and
min values of this table.
array size, min and max. This function must find and put the 2 values (minimum and
maximum) in the max and min parameters.
Write in two different ways, a program that checks without using a function of <string>, if a
keyed CH string is a palindrome:
Reminder: A palindrome is a word that stays the same whether you read it from left to
b. Then write the circle structure, consisting of the center of the circle (which is a point) and
its radius which is an integer.
c. Enter the data of a circle on the keyboard and calculate its perimeter and area
d. Then enter a point on the keyboard and test if this point belongs to the circle
Solution
#include <stdio.h>
#include <math.h>
#define PI 3.14
int main()
Cercle C;
scanf("%f %f",&C.Centre.X,&C.Centre.Y);
scanf("%d",&C.Rayon);
Point P;
scanf("%f %f",&P.X,&P.Y);
float d= sqrt(pow(P.X-C.Centre.X,2)+pow(P.Y-C.Centre.Y,2));
d<=C.Rayon ? printf("Le point P est dans le cercle") : printf("le point P est en dehors
du cercle");
return 0;