Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In which of the following expressions can the parenthesis be removed without affecting the meaning of the expression? Assume ptr is an integer pointer. Select

In which of the following expressions can the parenthesis be removed without affecting the meaning of the expression? Assume ptr is an integer pointer. Select one or more:

a) flags = flags | (1 << 3);

b) flags = flags & ~(1 << 5);

c) flags = x << (3 *2 + 1);

d) flags = flags & (~0177);

e) flags = * ( ptr + 1);

Which of the following are NOT valid C integer literals? Select one or more:

a) int x = 014;

b) int x = 1011001;

c) int x = 027UL;

d) int x = 0X3b;

e) int x = 0xf2G;

f) int x = 0382;

Given the declaration

char messages[4][8] = {"Hello","Hi", "There", "Bye"};

int arrInt[4][3] = {{1,2,3}, {4,5,6}, {7,8,9}{10, 11, 12}};

Which are the valid call(s) on the arrays? Select one or more:

a) printf("%c", messages[1] );

b) scanf("%s", message[1]);

c) printf("%d", arrInt[1] );

d) printf("%d", strlen(messages[1][0] );

e) messages[1][0] = messages[2][1];

f) fgets(arrInt[2], 3, stdout);

g) strcat(messages[2], "Hello World");

h) scanf("%d", &arrInt[1][0]);

Suppose variable k got value 6. Also suppose a[j] has address 1000.

Which of the following expressions evaluate to 1? Assume int has 4 bytes.

int a[] = {7,3,5,6,8,9,2,4,1};

int * p = a + i;

int * q = a + j;

int k = p - q;

Select one or more:

a) &a[i] == 1024

b) i - j == 6

c) &a[i] == 1006

d) p > q

e) i - j == 5

f) *p > *q

Which of the following could be a valid function calls in place of processArr( ?? )

int main() {

char msg[] = "Hello World";

char * p = msg;

processArr ( ?? );

}

void processArr (char arr[]) {

arr[0] = 'A';

}

Select one or more:

a) processArr ( *p + 2 )

b) processArr ( &(p+3) )

c) processArr ( *(p+3) )

d) processArr ( p )

e) processArr ( &msg[2] )

f) processArr ( *(msg+3) )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

engineering computations interactive practice strings

Answered: 1 week ago