Looking for CC - P1 - Promo 2029 test answers and solutions? Browse our comprehensive collection of verified answers for CC - P1 - Promo 2029 at moodle.myefrei.fr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Une fonction int distance(t_point p, t_point q) calcule la distance entre deux points p et q vous est donnée.
On souhaite écrire une fonction int compare_points(t_point p, t_point q) qui compare deux points p et q en fonction de leur distance par rapport au point de coordonées (0, 0). Elle renvoie un entier négatif si p est plus proche de l'origine que q, un entier positif si p est plus loin que q et 0 si les deux points sont à la même distance de l'origine.
Parmi les définitions suivantes, laquelle est correcte ?
La suite d'instructions suivante déclare puis initialise un tableau de 2 t_point.
t_point points[2];
t_point a = {1, 2};
t_point b = {3, 4};
points[0] = a;
points[1] = b;
Parmi les affirmations suivantes, lesquelles sont vraies ?
On souhaite trier un tableau de points en fonction de leur distance par rapport à l'origine avec l'algorithme du tri par insertion telle qu'il est décrit dans le cours. En supposant que vous disposez de la fonction tabint compare_points(t_point p, t_point q) décrite précédemment qui compare deux points p et q en fonction de leur distance par rapport à l'origine, à quelle condition doit-on échanger les points tab[j] et tab[j-1] ?
On considère la suite d'instructions suivante :
t_circle ** circles = (t_circle **)malloc(10 * sizeof(t_circle *));
for (int i = 0; i < 10; i++) {
circles[i] = create_circle(i, i, i + 1);
}
Parmi les affirmations suivantes, lesquelles sont vraies ?
La fonction print_circle affiche les informations d'un cercle de type t_circle: les coordonnées de son centre et son rayon. Parmi les définitions suivantes, laquelle est correcte ?
On souhaite écrire une fonction qui met à jour les coordonnées d'un t_point. Parmi les prototypes suivants, lequel est correct ?
We would like to sort an array of points based on their distance from the origin using the insertion sort algorithm as described in the course. Assuming you have the function arrint compare_points(t_point p, t_point q) described previously that compares two points p and q based on their distance from the origin, under what condition should we swap the points arr[j] and arr[j-1]?
A function int distance(t_point p, t_point q) computes the distance between two points p and q.
We would like to write a function int compare_points(t_point p, t_point q) that compares two points p and q based on their distance from the origin (0, 0). It returns a negative integer if p is closer to the origin than q, a positive integer if p is further than q, and 0 if both points are at the same distance from the origin.
Among the following definitions, which one is correct?
The following sequence of instructions declares and initializes an array of 2 t_point.
t_point points[2];
t_point a = {1, 2};
t_point b = {3, 4};
points[0] = a;
points[1] = b;
Among the following statements, which ones are true ?
Consider the following sequence of instructions :
t_circle ** circles = (t_circle **)malloc(10 * sizeof(t_circle *));
for (int i = 0; i < 10; i++) {
circles[i] = create_circle(i, i, i + 1);
}
Among the following statements, which ones are true ?