answer.
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
kykrilka [37]
2 years ago
10

Suppose we number the bytes in a w-bit word from 0 (least significant) to w/8 − 1 (most significant). Write a code for the follo

wing C function, which will return an unsigned value in which byte i of argument x has been replaced by byte b:
unsigned replace_byte (unsigned x, int i, unsigned char b);
Computers and Technology
1 answer:
castortr0y [4]2 years ago
4 0

Answer and Explanation:

// header file

#include <stdio.h>

// function to replace value

unsigned replace_byte(unsigned x,int i,unsigned char b){

  char* p = (char*)(&x);

  p[i] = b;

  return x;

}

int main(){

  // declare variables

  unsigned n = 0x12345678;

  unsigned r1,r2;

  // display result

  printf("%x\n%x\n",replace_byte(n,2,0xAB),replace_byte(n,0,0xAB));

}

output

                                                                                                                                               12ab5678                                                                                                                                                    

123456ab                                                                                                                                                    

You might be interested in
Which is the term for a computer typically located in an area with limited security and loaded with software and data files that
wariber [46]

Answer:

c. honeypot

Explanation:

A honeypot is a computer or a network used to mimic the actual target of a cyberattack. It is also used to detect attacks on the network and divert them from the real network. This is used to gain insight into how cyberattacks are carried out. With such knowledge, robust security systems can be put in place.

4 0
2 years ago
Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia"). Assume also that stdin is a v
zaharov [31]

Answer:

// program in java.

import java.util.*;

// class definition

class Main

{// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input

Scanner scr=new Scanner(System.in);

 // ask to enter name

System.out.print("Enter Your name: ");

 // read name from user

String NAME=scr.nextLine();

// print message

System.out.println("Greetings,"+NAME);

     

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read name from user with the help of scanner object and assign it to variable "NAME".Then print a Greetings message as "Greetings,NAME" where NAME will be  replaced with user's input name.

Output:

Enter Your name: Rachel                                                                                                    

Greetings,Rachel

5 0
2 years ago
Carrie works on a help desk and is assigned a ticket that was automatically generated by a server because of an error. The error
mixas84 [53]

The windows tool of weapon of choice that Carrie will use to troubleshoot the server is Powershell. All those GUI consoles built by Microsoft for Windows, by default, execute Powershell commands behind the scenes. Every possible thing that Carrie can do with the physical server can easily be accessible through Powershell's command line interface

Further Explanation

I would honestly say that there are a few available tools that Carrie can use, but the best tool is the inbuilt Windows Powershell. As Powershell continues to extend its purpose and usefulness, Microsoft, on the other hand, continues to use Powershell's capability to develop more cmdlets for products like Windows Servers.

Everything that can be done in a GUI environment can be done in Powershell. Carrie should be able to use Powershell to run things more efficiently from the command line without stepping a foot on the physical server. She will only need to access the server from her desk remotely, run a few commands, and that is it. Powershell command line is so powerful; it carries with it every troubleshooting pack that you can think about.

Learn More

brainly.com/question/10178399

brainly.com/question/10338479

#LearnWithBrainly

5 0
2 years ago
Read 2 more answers
Question 1:State the values of a, b, c, d and e after the following operations are carried out:
pychu [463]

Answer:

1.

a = 1

b = 20(int). 20,2857143(double)

c = 39

d = 7.6

e = 456

2.

x = 98

y = 99

z = 97

w = ca

print(x,y,z,w) -> 98 99 97 ca

3.

x = Please

y = walk on the gras

Pleasewalk on the gras

Explanation:

you can use IDE/Interpreter python to get clue number 3 and number 2

Sorry for bad English.

5 0
2 years ago
Kirk found a local community college with a two-year program and he is comparing the cost with that of an out-of-state two-year
Dafna11 [192]

What is the expected total cost for one year at the local community college if Kirk lives at home?

Answer: $6845



What is the expected total cost for one year at the out-of-state school if Kirk lives on campus?

Answer: $30,566

5 0
2 years ago
Read 2 more answers
Other questions:
  • Michael has increased the contrast of the given picture. Which feature or menu option of a word processing program did he use?
    14·2 answers
  • The OSHA Workplace Poster 3165 is optional for workplaces.<br> A) True<br> B) False
    13·2 answers
  • What company built its first computer from a wooden box
    12·2 answers
  • Determine the number of bytes necessary to store an uncompressed binary image of size 4000 × 3000 pixels.
    9·1 answer
  • 14. Emelia is very concerned about safety and has conducted a study to determine how many bike helmets were replaced at each loc
    13·2 answers
  • Wendy is an attacker who recently gained access to a vulnerable web server running Microsoft Windows. What command can she use t
    9·1 answer
  • What are some reasons DNS is necessary? Check all that apply. A. It maps local addresses to simple names without editing hosts f
    7·1 answer
  • Show how the recursive multiplication algorithm computes XY, where X = 1234 and Y = 4321. Include all recursive computations.
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    9·1 answer
  • Which of the following best describes the protocols used on the Internet?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!