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]
4 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]4 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
PLEASE HELP ME ASAP!!! Looking at the misty rain and fog (pictured above) Explain at least two defensive driving techniques you
JulsSmile [24]
1.Slow down 2. Break earlier
7 0
3 years ago
Some request lists might cause the disk scheduler to act the same when the three different algorithms are run. Create a request
storchak [24]

Answer:

35, 25, 50, 75, 95

Explanation:

List of five track numbers that will cause all three algorithms to visit the same tracks in the same order are -

35

25

50

75

95

Please go to attachment for the diagram how these 5 tracks will be traversed by various algorithms.

All the algorithms traverse in the order 35 -> 25 -> 50 -> 75 -> 95

7 0
4 years ago
Write a c program to count the total number of commented characters and words in a c file taking both types of c file comments (
Tanzania [10]

#include<stdio.h>

#include<stdlib.h>

int comment1(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\n')

       {

           return count;

       }

       count++;

   }

   return count;

}

int comment2(FILE *fp)

{

   char ch;

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='*')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               return count;

           }

           count++;

       }

       count++;

   }

   return 0;

}

int main()

{

   printf("Enter the file name:");

   char s[1000],ch,ch1;

   scanf("%s",s);

   FILE*fp;

   fp = fopen(s,"r");

   int count=0;

   while(fscanf(fp,"%c",&ch)!=EOF)

   {

       if(ch=='\"')

       {

           while(fscanf(fp,"%c",&ch)!=EOF)

           {

               if(ch=='\"')

               {

                   break;

               }

               if(ch=='\\')

               {

                   fscanf(fp,"%c",&ch);

               }

           }

       }

       else if(ch=='/')

       {

           fscanf(fp,"%c",&ch);

           if(ch=='/')

           {

               count += comment1(fp);

           }

           else if(ch=='*')

           {

               count += comment2(fp);

           }

       }

   }

   printf("%d\n",count);

   return 0;    

}

3 0
3 years ago
Read 2 more answers
PushBullet is an app to talk with people. Look it up and let me know u got it.
lisov135 [29]

Answer:

k

Explanation:

5 0
3 years ago
Read 2 more answers
Where should you click to edit an existing formula?
user100 [1]

Answer:

You can edit the existing formula by clicking the cell in which formula is referenced, then edit the formula in the formula bar. (option c is correct)

Explanation:

This question is about how to edit the existing formula. In Excel, you can edit the formula. First, you have to click the cell in which the formula is written. Then you have to edit it in the formula bar. However, if you know and remember the formula, you can edit directly in the cell. But the best practice is to edit the formula in the formula bar.

Why other options are not correct.

  • In a cell that is referenced in the formula:

The cell that is referenced in the formula does not affect the formula. Because to edit something in the referenced cell, does not guarantee to affect the formula that you want to edit. To edit the existing formula, you click the cell in which formula is written, then edit it in the formula bar.

  • In the first blank cell of the worksheet

It is not necessary, that there would be a formula in the first cell. But, if there is a formula in the first cell, you should edit the formula directly in the formula bar.

  • In the status bar

You can't edit the existing formula in the status bar because the status bar is used for showing the status of actions you are doing in excel. The status bar is shown at the bottom of the excel sheet.

3 0
3 years ago
Read 2 more answers
Other questions:
  • A company database consists of 10,000 sorted names, 40% of whom are known as good customers and who together account for 60% of
    13·1 answer
  • Terry came into work and turned on his computer. During the boot process, the computer shut down. When he tried again, the compu
    14·1 answer
  • How do you use the Internet? Think about your typical day. When are you using the Internet? For what purposes? What role does it
    11·1 answer
  • The blank areas around the outside edges of a document are called the _____. a. settings b. margins c. blank space d. empty spac
    14·1 answer
  • You have recently resolved a problem in which a user could not print to a particular shared printer by upgrading her workstation
    12·1 answer
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • The five types of personal computers are: desktops, laptops, tablets, smartphones, and ________.
    13·1 answer
  • HELP ASAP 50 POINTS AND BRAINLIST PLZ NO FAKE ANSWER I BEG!!!!!!!!!!!!!!!!!!!!!!!!!!
    15·2 answers
  • The first real computer was an abacus?
    13·1 answer
  • 4.1 code practice python
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!