1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
pickupchik [31]
3 years ago
9

1. An integer in C (int) is represented by 4 bytes (1 byte = 8 bits). Find the largest integer that can be handled by C. Verify

that number by computer (try to printf that number, and printf that number +1). No programming is required for this. Hint: (a) Conversion from binary to decimal: 3 2 1 0 2 1101 =1 2 + 0 2 +1 2 +1 2 = 8 + 0 + 2 +1 10 =11 (b) If an integer is represented by 1 byte (8 bits), the maximum integer number is 1111111 (Seven 1's as one bit must be reserved for a sign). 6 5 0 2 1111111 =1 2 +1 2 ++1 2 1 2 1 7 =  − =128 −1 (c) The number looks like a telephone number in Dallas.
Computers and Technology
1 answer:
faust18 [17]3 years ago
4 0

Answer:

Check the explanation

Explanation:

In C, int requires 4 butes to sotre a integer number. that means it requires 4*8 = 32 bits. The maximum number can be stored using 32 bits is

(11111111111111111111111111111111)_2

The first digit is used for sign. decimal equivalent to this number can be computed as

(1111111111111111111111111111111)_2= 1\times2^{30}+1\times2^{29}+...+1\times2^0

=1\times2^{31}-1

= 2147483647-1=2147483646

That means int can store a up to 2147483646.

                      Testing with C code

#include<stdio.h>

int main()

{

  int a = 2147483647; // a with max number

  printf("%d\n",a);// printing max number

  a = a+1;// adding one to the number

  printf("%d\n",a);// printing the number after adding one

  return 0;

}

                THE OUTPUT

$ ./a.out

2147483647

-2147483648

You might be interested in
a central issue in the microsoft antitrust lawsuit involved microsoft's integration of its internet browser into its windows ope
Tomtit [17]

A central issue in the Microsoft antitrust lawsuit involved Microsoft's integration of its internet browser into its windows operating system, to be sold as one unit is a practice that is known as: C. tying.

<h3>What is an operating system?</h3>

In Computer technology, an operating system (OS) can be defined as a system software that's usually pre-installed on a computing device by the manufacturers, in order to manage random access memory (RAM), software programs, computer hardware and all user processes.

Microsoft was involved in an antitrust lawsuit with respect to tying the integration of its internet (web) browser into its windows operating system (OS) such as Windows 7, 8, 10, etc., in order to sell them to end users as a single unit.

Read more on operating system here: brainly.com/question/22811693

#SPJ1

8 0
9 months ago
A Write about why it is important for a person to upgrade their job skills
Alexxx [7]

It is important for a person to upgrade their job skills because upgrading their skills will Increase their self-confidence, Helps to learn new techniques at work, Keep Your Knowledge Up-to-Date, increase your ability  in order to do your job well, and so on.

<u>Explanation:</u>

The most significant purposes behind abilities improvement in an association is for the development significant by and by and in an association. Workers need to remain learning so as to develop. At the point when you are going after another position, it's extremely significant that you can exhibit that you stay up with the latest. With certain callings, it's obligatory.

And, the more the abilities hole is developing, the more significant these three viewpoints become. This is on the grounds that we have to unmistakably comprehend whether it is information, expertise or capacity that should be created.

7 0
3 years ago
______ is the software that blocks a user from being able to access your computer.
antiseptic1488 [7]
The answer is firewall. It is a network security device that observes inbound and outbound network traffic and chooses whether to allow or block specific traffic based on a well-defined set of security rules. Firewalls have been a first line of protection in network security for over 25 years. The firewall present a barrier between measured and secured internal networks that can be trusted and untrusted outside networks, for example the Internet. A firewall can be software, hardware, or even both.
8 0
3 years ago
Declare a structure with a type name: Car containing:
OLga [1]

Answer:

C++ code is given below

Explanation:

#include <iostream>

#include <cctype>

#include <string.h>

#include <cstring>

#include <sstream>

using namespace std;

struct Car {

public:    

char reportingMark[5];    

int carNumber;

string kind;

bool loaded;

string destination;

};

void input(Car *);

void output(Car *);

int main() {

Car *T = new Car;    

input(T);

output(T);    

delete T;    

return 0;

}

void input(Car *T)

{

string str, s;

cout << " Enter the reporting mark as a 5 or less character uppercase string: ";

cin >> str;

for (int i = 0; i < str.length(); i++)

T->reportingMark[i] = toupper(str[i]);

cout << " Enter the car number: ";

cin >> T->carNumber;

cout << " Enter the kind: ";

cin >> T->kind;

cout << " Enter the loaded status as true or false: ";

cin >> s;    

istringstream(s) >> boolalpha >> T->loaded;    

if (T->loaded == true) {

cout << " Enter the destination: ";

cin.ignore();

getline(cin, T->destination);

}

else

T->destination = "NONE";    

}

void output(Car *T)

{

cout << " Reporting Mark: " << T->reportingMark;

cout << " Car Number: " << T->carNumber;    

cout << " Kind: " << T->kind;

cout << " Loaded Status: " << boolalpha << T->loaded;

cout << " Destination: " << T->destination << " ";

}

7 0
3 years ago
What do you do to think positive and maintain discipline to play
Agata [3.3K]

Answer:

to make peaceful mind.to develop our character..

6 0
3 years ago
Other questions:
  • Whichof the following is not a standard method called as part of the JSPlife cycle?jspInit()jspService()_jspService()jspDestroy(
    12·1 answer
  • Which of the following is an example of a problem that could be attributed to poor ergonomics?
    10·1 answer
  • You are able to change the formatting of a table after it is inserted into a placeholder. True or false
    9·2 answers
  • What’s the answer?............................
    13·1 answer
  • Which of the following statements best deceive the relationship between carrying capacity and population size
    12·1 answer
  • 5. Which of the following views is used to run a PowerPoint presentation?
    11·2 answers
  • Questions Presscomion
    9·1 answer
  • Group of answer choices When declaring a variable, you also specify the type of its values. Variables cannot be assigned and dec
    7·1 answer
  • A style sheet consists of CSS ______________________ that specify the layout and format properties to apply to an element. *
    13·1 answer
  • SLA:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!