logo

Crowdly

Browser

Додати до Chrome

Questions Bank (1527141 total)

Given the following declarations: 

int num [10] = {23, 3, 5, 7, 4, -1, 6, 12, 10, -23}; 

int i = 2;

Write an expression that evaluates to the same value as *(num + i).

Переглянути це питання

What happens if you modify the elements of an array inside a function that received it as a parameter? 

0%
0%
0%
0%
Переглянути це питання

What does the strcmp() function return if the two strings it receives as arguments are the same? 

Переглянути це питання

In the below statement,

x and y are

uninitialized pointers to int. That is, they are pointing to some random address

that may or may not be valid address.

int * x, y;

0%
0%
Переглянути це питання

What is the ASCII value of the NUL character (\0) used to terminate a string?

Переглянути це питання

Fix the bugs in the following program by rewriting only those statement(s) that need to be modified:

#include <stdio.h>

int main() {

    int *ptr, i = 10;

    ptr = &i;

    i += 20;

    printf("Value of i is %d and is stored at %d.\n", ptr, *ptr);

    return 0;

}

Переглянути це питання

Which operator is

used to access the value stored at the address held by a pointer?

❌
✅
❌
❌
❌
Переглянути це питання

Given the following code:

1  int arr[] = {5, 10, 15, 20, 25, 30};

2 int *ptr1 = arr;

3 int *ptr2 = ptr1 + 5;

If the base address of

arr is 4001, what will be the value of

ptr2 after line 3? (Just write the value in the box provided, and nothing else.)

Переглянути це питання

What is the significance of the *ptr notation on the left-hand side (LHS) of an assignment statement?

0%
0%
0%
0%
Переглянути це питання
What is the output of the following program?

#include <stdio.h>

#include <string.h>

void foo(char []);

int main()

{

  char arr[40] = "Plaksha";

  printf("%d, %d\n", sizeof(arr), strlen(arr));

  foo(arr);

  return 0;

}

void foo(char p[])

{

  printf("%d, %d\n", sizeof(p), strlen(p));

  return;

}

Переглянути це питання