logo

Crowdly

Browser

Add to Chrome

CC - P1 - Promo 2029

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!

On considère un tableau d'entiers tab de taille n. En supposant que tab[0] se trouve à l'adresse mémoire @80 que vaut int * p = tab + n ?

View this question

On souhaite écrire une fonction swap qui échange les valeurs de deux variables entières a et b. Parmi les propositions suivantes, quelle est la bonne implémentation de la fonction swap ?

View this question

Consider the following program. Among the following statements, which ones are true?

#include<stdio.h>

#define N 10

int main() {

int t[] = {1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0};

int l = 0, r = N - 1;

int cpt = 0;

while (l <= r) {

cpt++;

int m = l + (r - l) / 2;

if (t[m] == 1) {

l = m + 1;

} else {

r = m - 1;

}

}

printf("%d %d\n", l, cpt);

return 0;

}

0%
View this question

Quelle est la sortie du programme suivant ?

#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;

}

View this question

En exécutant le programme suivant, combien de fois la chaîne "hello" est-elle affichée ?

#include <stdio.h>

int main() {

int i = 0;

for (; i < 5; i++) {

printf("hello\n");

}

return 0;

}

0%
0%
View this question

After executing the following program, how many times is the string "hello" displayed?

#include<stdio.h>

int main() {

int i = 0;

while (i < 5) {

printf("hello\n");

}

return 0;

}

View this question

Après l'exécution de ces lignes d'instruction, que vaut *p ?

int a = 5;

int b = 3;

int * p = &a;

a = b;

View this question

On considère les instructions suivantes. Parmi les affirmations suivantes, laquelle est vraie ?

int * p = (int *) malloc(sizeof(int));

*p = 42;

View this question

En supposant que l'utilisateur entre la valeur 4, que va afficher le programme suivant ?

#include<stdio.h>

int main() {

int a;

scanf("%d", &a);

if (a < 5)

printf("a est inférieur à 5\n");

printf("a est supérieur à 5\n");

return 0;

}

0%
0%
0%
0%
View this question

On souhaite allouer dynamiquement un tableau de n caractères. Parmi les propositions suivantes, laquelle permet d'y parvenir ?

View this question

Want instant access to all verified answers on moodle.myefrei.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome