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!

After executing the following lines of instructions, what is the value of *p ?

int a = 3;

int b = 5;

int * p = &a;

a = b;

View this question

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, in how many iterations is the array int T[6] = {-1, 3, 42, 21, 11, 13} sorted?

0%
0%
50%
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) {

int i = 0;

printf("hello\n");

i++;

}

return 0;

}

0%
0%
0%
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, -1, -1, -1, -1, -1};

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;

}

View this question

Assuming that the user enters the value -1, what will the following program display?

#include<stdio.h>

int main() {

int a;

scanf("%d", &a);

if (a < 10)

printf("a is less than 10\n");

printf("a is greater than 10\n");

return 0;

}

View this question

We want to dynamically allocate space for a string of length n. Among the following statements, which one allows to achieve this?

0%
0%
0%
0%
View this question

What is the output of the following program?

#include<stdio.h>

int main() {

int i = 0, j = 0;

char str[10] = "abcdef";

char str2[10];

while (str[i] != '\0') {

i++;

}

str2[i] = '\0';

while (i >= 0) {

str2[--i] = str[j++];

}

printf("%s\n", str2);

return 0;

}

View this question

We want to write a function sum that computes and returns the average of an array of float tab of size n. Among the following statements, which one is the correct function header?

0%
0%
0%
0%
View this question

Consider the following string char s[] = "abcde". Among the following statements, which ones are true?

0%
0%
0%
0%
View this question

The selection sort algorithm allows to sort an array in a certain order. Among the following statements, which one best describes this sorting algorithm?

0%
0%
0%
0%
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