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!

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

0%
0%
0%
0%
View this question

We want to dynamically allocate an array of n characters. Among the following propositions, which one allows to achieve this?

View this question

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;

}

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

View this question

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?

0%
0%
0%
View this question

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;

}

0%
0%
0%
0%
View this question

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

0%
0%
0%
0%
View this question

The insertion 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

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?

0%
0%
0%
View this question

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 ?

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