Question

14. Given the following declaration char x = -11; char y = 63; if the computer...

14. Given the following declaration char x = -11; char y = 63; if the computer uses 2’s complement to represent the numbers then which statement is correct: a. The number of bits in x is equal to the number of bits in y b. The number of bits in x is less than the number of bits in y c. The number of bits in x is greater than the number of bits in y d. None of the above

15. What will be the output of the following code

int x = 5; int y = 2;

f(x,y);

printf(“%s \n”, (x/y > 2) ? “x is more than two times larger than y” : “x is less than or equal to 2*y\n ”);

f(int x, int y) { x = 2*y; printf(“%s \n”, (x/y > 2) ? “x is more than two times larger than y” : “x is less than or equal to 2*y \n”); }

a. x is less than or equal to 2*y x is less than or equal to 2*y

b. x is less than or equal to 2*y x is more than two times larger than y


c. x is more than two times larger than y x is less than or equal to 2*y

d.x is more than two times larger than y x is more than two times larger than y

0 0
Add a comment Improve this question Transcribed image text
Answer #1

14) a. The number of bits in x is equal to the number of bits in y

explanation:char occupy 8 bits.

15)

a. x is less than or equal to 2*y x is less than or equal to 2*y

Add a comment
Know the answer?
Add Answer to:
14. Given the following declaration char x = -11; char y = 63; if the computer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 12. if x = 0x25 then which of the following statements is correct a) if y...

    12. if x = 0x25 then which of the following statements is correct a) if y = x | (1<<1) then y is 0x26 b) if y = x << 1 then y is 0x4A Review questions COMP 2401 Fall 2019 Page 4 of 14 c) if y = x & 0x37 then y is 0x35 d) if y = x | 0x37 then y is 0x35 e) All of the above statements are incorrect 13. What will be the...

  • What will be the output of the following code int x = 5; int y =...

    What will be the output of the following code int x = 5; int y = 2; f(x,y); printf(“%s \n”, (x/y > 2) ? “x is more than two times larger than y” : “x is less than or equal to 2*y\n ”); f(int x, int y) { x = 2*y; printf(“%s \n”, (x/y > 2) ? “x is more than two times larger than y” : “x is less than or equal to 2*y \n”); } a. x is...

  • Create a UNIX makefile for the following C program: //convert.c char toUpper(char c){ if(c>='a' && c<='z')...

    Create a UNIX makefile for the following C program: //convert.c char toUpper(char c){ if(c>='a' && c<='z') return c-32; return c; } //converting sentance to upper void convertSentence(char *sentence){ int i=0; while(sentence[i]!='\0'){ //convert to upper for each character sentence[i] = toUpper(sentence[i]); i++; } } //converting all sentences into uppercase void convertAll(char **sentenceList, int numOfSentences){ int i=0; while(i<numOfSentences){ //calling convertsentence function to conver uppercase convertSentence(sentenceList[i]); i++; } } sentences.c #include<stdio.h> #include<stdlib.h> #include "convert.c" int main(){ //declaring character array char **mySentences; int noOfSentences;...

  • C program take values to 9 and the second can take values to 12 if (x...

    C program take values to 9 and the second can take values to 12 if (x > 2^3) printf("d", x); Int s-e; 21. LOST) Write a statement that declare an array of doubles with two indices, such that the first index can 22 (LOL) The following code will print out: 23. (L02.) The following code will print out: PART 2 Fill in the banks questions 3 marts x + 5; else x -- 2; char "stri - "abcd"; char str2[]...

  • D Question 8 1 pts void siq handlerO printf("Beepin-) i alarm(1) int main) ( if (signal (SIGALRM, sig handler) SIOERR) ( prints ("railed to bind handlerin-)? printf ("Going into an in...

    D Question 8 1 pts void siq handlerO printf("Beepin-) i alarm(1) int main) ( if (signal (SIGALRM, sig handler) SIOERR) ( prints ("railed to bind handlerin-)? printf ("Going into an intinite loop\nT) alarm(1) while (1) return 0 Suppose the above program is run for 5.5 seconds after it prints "Going into an infinite loop: The program is run multiple times where the "system load" from other processes sharing the cpu will vary from none to many other processes. Which best...

  • Please solve the problems from 2_5 Digital system Problem 2 Design a combinational circuit with inputs...

    Please solve the problems from 2_5 Digital system Problem 2 Design a combinational circuit with inputs a, b, c, d and outputs w, x, y, z. Assume that the inputs a, b, c d represent a 4-bit signed number (2s complement). The output is also a signed number in 2s complement which is 5 greater than the input if the input is less than 2, and is 2 less than the input if the input is greater than or equal...

  • Identify and correct the errors in each of the following [Note: There may be more than...

    Identify and correct the errors in each of the following [Note: There may be more than one error in each piece of code]: a) if ( age >= 65 );   printf( "Age is greater than or equal to 65\n" ); else printf( "Age is less than 65\n" ); b) int x = 1, total;     while ( x <= 10 )                {               total += x;                 ++x;            } c) While ( x <= 100 ) total +=...

  • Please solve the problems from 1_5 Digital system Complete the following homework problems. Show all work...

    Please solve the problems from 1_5 Digital system Complete the following homework problems. Show all work (making sure it is legible) and circle all answers for clarity Problem 1 w3 w4 B w1 a) Determine Boolean functions for intermediate outputs w,w2,w3, and w4 as well as the output signals X and Y. b) Construct a truth table showing the intermediate outputs wl,w2,w3, and w4 as well as the output signals X and Y c) Use K-maps to find simplified expressions...

  • Using Microsoft Visual Studio. 1) Complete the following C++ program by adding more line of code...

    Using Microsoft Visual Studio. 1) Complete the following C++ program by adding more line of code for 8-bit signed array, 16-bit unsigned array, 16-bit signed array, 32-bit signed array and 32-bit signed array. 2) Fill in all the blanks in Table 1 using your completed code, following the hints provided within the table. 3) Fill in all the blanks in Table 2 using your completed code, following the hints provided within the table. C++ Program #include <stdio.h> #include <iostream> int...

  • Given the struct xx with the following members: int x-3; char namell-"hello"; What would be the...

    Given the struct xx with the following members: int x-3; char namell-"hello"; What would be the output of the following program? 1. void main) 2. 3. struct xx "s-malloc(sizeof(struct xx)); 4, printf("%d",s->x); 5. printf("%s",s->name); 3 hello Garbage value hello 3 Garbage Value Compiler error None of the above

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT