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!
Consider the following string char str[] = "hello". Among the following statements, which ones are true?
We want to dynamically allocate an array of n characters. Among the following propositions, which one allows to achieve this?
What is the output of the following program?
#include<stdio.h>
int main() {
int i = 0;
char str[10] = "abcdef";
char str2[10];
while (str[i + 1] != '\0') {
str2[i] = str[i];
i++;
}
str2[i] = '\0';
printf("%s\n", str2);
return 0;
}
The bubble sort algorithm sorts an array by placing the largest element in its place at each iteration. By stopping the algorithm as soon as the array is sorted, how many iterations does the array int T[6] = {-1, 3, 7, 42, 13, 21} need to be sorted?
We want to write a function swap that exchanges the values of two integer variables a and b. Among the following propositions, which one is the correct implementation of the swap function?
Assume that the user enters the value 4, what will the following program display?
#include<stdio.h>
int main() {
int a;
scanf("%d", &a);
if (a < 5)
printf("a is less than 5\n");
printf("a is greater than 5\n");
return 0;
}
After executing the following instructions, what are the value of the variables str1 and str2 ?
char str1[100] = "Howdy, ";
char str2[100] = "partner!";
char * p1 = str1;
char * p2 = str2;
while (*p1 != '\0') p1++;
while (*p2 != '\0') *(p1++) = *(p2++);
*p1 = '\0';
The insertion sort algorithm allows to sort an array in a certain order. Among the following statements, which one best describes this sorting algorithm?
We want to write a function average that computes and returns the average of an array of integers tab of size n. Among the following propositions, which one is the correct function header?
Consider an array of integers tab of size n. Assuming that tab[0] is located at memory address @80, what is the value of int * p = tab + n ?