Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Complete the above program so that the output of the program is 101 202. That is, a becomes 101, b becomes 202. You cannot added

image text in transcribed

Complete the above program so that the output of the program is 101 202. That is, a becomes 101, b becomes 202.

You cannot added new codes, just replace the ?, ??, ???, ????, ?????, ??????.

image text in transcribed

Consider the code above. Function checkbit(int a, int x) checks if bit-x of a is on (i.e., 1) or off (i.e., 0).

Denote the right-most bit as bit-0. For example, checkbit(10, 2) should print "bit-2 is off", and checkbit(10,3) should print "bit-3 is on"

Complete if statement of the function.

image text in transcribed

Consider the code above. Assume it is run on a 32 bits system, where pointer has size 4 bytes regardless of type.

List the output of the program (in the order of the program execution).

#include void processA(int*, int *); void processB(int*, int ** ); int main() { int a= 1, b=2; processA?, ??); printf("%d %d ", a, b); } void processA(int* x, int* y){ process ???, ???? ); } void process(int* x, int** y){ ????? ; ?????? ; #include void checkBit(int a, int x); int main() { int k, X; scanf("%d %d", &, &x); checkBit(k, x); } /* determine if bit-x of a is on or off */ void checkBit(int a, int x){ if ( ) printf("bit-%d is on ", x); else printf("bit-%d is off ", x); } int main() { char arr [] = "Hello World"; char * p = arr; printf("%d ", strlen(arr)); printf("%d ", strlen()); printf("%d ", sizeof arr); printf("%d ", sizeof p); aFunction(arr); } int aFunction (char c[]){ printf("%d ", strlen(c)); printf("%d ", sizeof(c)); }

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: 3

blur-text-image

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