In C complete the following:

void printValues ( unsigned char *ptr, int count) // count is no of cells
{
print all values pointed by ptr. //complete this part
}
int main ( )
{

unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;
call the printValues function passing the array data //complete this part
}

Answers

Answer 1

Answer:

#include <stdio.h>

void printValues ( unsigned char *ptr, int count) // count is no of cells

{

 for(int i=0; i<count; i++) {

   printf("%d ", ptr[i]);

 }

}

int main ( )

{

 unsigned char data[ ] = { 9, 8, 7, 5, 3, 2, 1} ;

 printValues( data, sizeof(data)/sizeof(data[0]) );

}

Explanation:

Remember that the sizeof() mechanism fails if a pointer to the data is passed to a function. That's why the count variable is needed in the first place.


Related Questions

Consider a file system using the indexed allocation. The block size is 512 bytes and the pointer to a block takes 2 bytes. The largest file size that a one level indexed allocation method could handle is ___________ KB. Recall that 1KB is equal to 210 bytes. Answer -1 if there is no limit based on the provided information.

Answers

Answer:

128 KB      

Explanation:

Given data :

The block size = 512 bytes

Block pointer size = 2 bytes

In an indexed allocation, a special block named Index Block contains all the pointers to the blocks that the file had occupied.

Therefore, the maximum number of block pointer in 1 block :

[tex]$=\frac{\text{block size}}{\text{pointer size}}$[/tex]

[tex]$=\frac{512}{2}$[/tex]

= 256

Thus, a block can hold maximum 256 pointers.

It is given the level of indexing is one. So,

Maximum size of the file =  maximum number of block pointers in 1 file x block size

                                          = 256 x 512

                                          [tex]$=2^8 \times 2^9$[/tex]

                                          [tex]$=2^{8+9}$[/tex]

                                           [tex]$=2^{17}$[/tex]

                                          [tex]$=2^7 \times 2^{10}$[/tex]

                                          [tex]$=128 \times 2^{10}$[/tex]

                                          = 128 KB   (∵ 1 KB = [tex]2^{10} \ B[/tex] )

Therefore, the largest file that 1 level if indexed allocation method can handle is 128 KB.

Physical safeguards, also called logical safeguards, and are applied in the hardware and software of information systems.

a. True
b. False

Answers

Answer:

False

Explanation:

They are not applied in the hardware and software of information systems.

Does anyone know what type of Chromebook this is?

Answers

A chromebook of course lol jk look it up and u can find what kind it is

Answer: Its............ A Chromebook type of Chromebook...??

Explanation:

Ion know I aint a geek, geezer -_- (Thats a lie)

five technology tools and their uses​

Answers

Answer:

Electronic boards

Videoconferencing ability

Search engines

Cloud services

Computing softwares

Explanation:

Technology tools are used to simplify task bring ease, comfort as well as better satisfaction :

The use of electronic boards for teaching is an essential tool for students and educators alike as it provides great features aloowibg teachers to write and make drawings without hassle. This clear visual display goes a long way to aide student's understanding.

Videoconferencing breaks the barrier that distance and having to travel bring swhen it comes to learning. With this tools, students and educators can now organize classes without having to be physically present un the same class room.

Search engines : the means of finding solutions and hints to challenging and questions is key. With search engines, thousands of resources can now be assessed to help solve problems.

Cloud services : this provud s a store for keeping essential information for a very long time. Most interestingly. These documents and files can be assessed anywhere, at anytime using the computer.

Computing softwares : it often seems tune consuming and inefficient solving certain numerical problems, technology now p ovide software to handles this calculation and provides solutions in no time using embedded dded to codes which only require inputs.

(CO 4 and 5) Create a program that will read in a list of test scores from the user and add them to a list. Ask the user in between each score if they want to continue (y/n). Display all of the scores entered and the total score at the end. Using the code below, put the code in the proper order Sample output: Welcome to the Test Score Program Add score: 88.45 Do you want to continue

Answers

Answer and Explanation:

Using Javascript:

function AddScores(){

Window.alert("Welcome to the Test Score Program");

var ScoreList= new Array();

ScoreList.push(Prompt("Add Score"));

var WhatNext= Confirm("do you want to continue?");

If(WhatNext===true) {

do{

ScoreList.push(Prompt("Add Score"));

}

While(

Confirm("do you want to continue?")===true;);

}

Alert(ScoreList);

Alert(ScoreList.reduce(function(a,b){return a +b};,0);)

}

AddScores();

From the above code in javascript programming language, we have created a list ScoreList and added elements to it using push method of the array object and a do...while loop that checks the condition and then adds the user's input to the array. We then alerted the array to the screen and then summed up the array elements and also alerted to the screen.

The following method is intended to return true if and only if the parameter val is a multiple of 4 but is not a multiple of 100 unless it is also a multiple of 400. The method does not always work correctly public boolean isLeapYear(int val) if ((val 4) == 0) return true; else return (val & 400) == 0; Which of the following method calls will return an incorrect response?
A .isLeapYear (1900)
B. isLeapYear (1984)
C. isLeapYear (2000)
D. isLeapYear (2001)
E. isLeapYear (2010)

Answers

Answer:

.isLeapYear (1900) will return an incorrect response

Explanation:

Given

The above method

Required

Which method call will give an incorrect response

(a) will return an incorrect response because 1900 is not a leap year.

When a year is divisible by 4, there are further checks to do before such year can be confirmed to be a leap year or not.

Since the method only checks for divisibility of 4, then it will return an incorrect response for years (e.g. 1900) that will pass the first check but will eventually fail further checks.

Hence, (a) answers the question;

LAB: Warm up: Drawing a right triangle This program will output a right triangle based on user specified height triangle_height and symbol triangle_char. (1) The given program outputs a fixed-height triangle using a character. Modify the given program to output a right triangle that instead uses the user-specified triangle_char character. (1 pt) (2) Modify the program to use a loop to output a right triangle of height triangle_height. The first line will have one user-specified character, such as % or* Each subsequent line will have one additional user-specified character until the number in the triangle's base reaches triangle_height. Output a space after each user-specified character, including a line's last user-specified character. (2 pts) Example output for triangle_char = % and triangle_height = 5: Enter a character: Enter triangle height: 5 273334.1408726 LAB ACTIVITY 16.6.1: LAB: Warm up: Drawing a right triangle 0/3 main.py Load default template... 1 triangle_char - input('Enter a character:\n') 2 triangle_height = int(input('Enter triangle height:\n')) 3 print('') 4 5 print ('*') 6 print ("**') 7 print ("***') 8

Answers

Answer:

The modified program in Python is as follows:

triangle_char = input('Enter a character:\n')

triangle_height = int(input('Enter triangle height:\n'))  

for i in range(triangle_height):

   print(triangle_char * (i+1))

Explanation:

This gets the character from the user

triangle_char = input('Enter a character:\n')

This gets the height of the triangle from the user

triangle_height = int(input('Enter triangle height:\n'))  

This iterates through the height

for i in range(triangle_height):

This prints extra characters up to the height of the triangle

   print(triangle_char * (i+1))

Here's the modified program that incorporates the requested changes:

python

Copy code

triangle_char = input('Enter a character:\n')

triangle_height = int(input('Enter triangle height:\n'))

print('')

for i in range(1, triangle_height + 1):

   line = triangle_char * i + ' ' * (triangle_height - i)

   print(line)

This program uses a loop to iterate from 1 to triangle_height. In each iteration, it creates a line by concatenating triangle_char repeated i times with spaces (' ') repeated (triangle_height - i) times. The resulting line is then printed.

For example, if the user enters % as the character and 5 as the height, the output will be to make sure to maintain the indentation properly in your code for it to work correctly.

Learn more about python on:

https://brainly.com/question/30391554

#SPJ6

Select all that apply to Enums: Group of answer choices While mainly a readability feature, we can technically use Enum to do things like spoof a boolean type in C allowing us some level of functionality Enums let us build a series of any kind of constant Enums allow us to print names for integers instead of numbers Enums are great for representing states and other common constants like colors Enums let us specifically value each constant we create Flag question: Question 59 Question 59

Answers

Answer:

-- While mainly a readability feature, we can technically use Enum to do things like spoof a Boolean type in C allowing us some level of functionality.

-- Enums are great for representing states and other common constants like colors.

-- Enums let us specifically value each constant we create.

Explanation:

Enums is a part of a programming language which helps a developer or a programmer to defined a set of the named constants. Using the enums will help in making it easier to document the intent and also to create set of distinct cases.

Option 1 is applicable as in the Boolean there are only TRUE and FALSE values. By using enum one can add more state like that of being difficult or normal or easy.

Option 4 is applicable because enums are used to represent various states and also other constants.

Option 5 is also applicable they allow the developer to create each value constant.

what are the different steps while solving a problem using computer? explain​

Answers

Explanation:

The following six steps must be followed to solve a problem using computer.

Problem Analysis.

Program Design - Algorithm, Flowchart and Pseudocode.

Coding.

Compilation and Execution.

Debugging and Testing.

Program Documentation.

Which XXX declares a student's name. public class Student { XXX private double myGPA; private int myID; public int getID() { return myID; } } Group of answer choices String myName; public String myName; private myName; private String myName;

Answers

Question:

Which XXX declares a student's name.

public class Student {

   XXX

   private double myGPA;  

   private int myID;

   public int getID() {

        return myID;

   }

}

Group of answer choices

a. String myName;

b. public String myName;

c. private myName;

d. private String myName;

Answer:

private String myName;

Explanation:

To declare a student's name, the following should be noted.

i. The name of the student is of type String

ii. Since all of the instance variables (myGPA and myID) have a private access modifier, then myName (which is the variable name used to declare the student's name) should be no exception. In other words, the student's name should also have a private access.

Therefore, XXX which declares a student's name should be written as

private String myName;

Option (a) would have been a correct option if it had the private keyword

Option (b) is not the correct option because it has a public access rather than a private access.

Option (c) is not a valid syntax since, although it has a private access, the data type of the variable myName is not specified.

Option (d) is the correct option.

2. 5s is a Chinese principle adapted for use in the workplace.
True or False​

Answers

Answer:

A. true

Explanation:

because 5s is the.................

what is a microscope ​

Answers

Answer:

an optical instrument used for viewing very small objects, such as mineral samples or animal or plant cells, typically magnified several hundred times

Answer:

A microscope is a laboratory instrument used to examine objects that are too small to be seen by the naked eyes.

01 Describe all the possible component of a chart​

Answers

Answer:

Explanation:

1) Chart area: This is the area where the chart is inserted. 2) Data series: This comprises of the various series which are present in a chart i.e., the row and column of numbers present. 3) Axes: There are two axes present in a chart. ... 4)Plot area: The main area of the chart is the plot area

Other Questions
Give the 3 forces in playing sports. To prove ABC= ADC, To prove which triangle postulate could you use? SSSSASASAAAS Simplify: -8x +7-5-5x + 5xA- 8x + 2B-18x+12-x-5D-X+12 Can you help and do it step by step Describe TWO examples of how people back home are clueless when it comes to the war. Find the value of the variable(s). If your answer is not an integer, leave it in simplest radical form.560 10xNot drawn to scale In the presence of lactose, how long does it take for the lac operon to be expressed?(A) when glucose is more than lactose concentration(B) when lactose equals glucose concentration(C) as long as lactose is more than galactose concentration(D) as long as lactose is more than glucose concentration what were some of the main economic problems found in Sri Lankaimmediately after independence? the number of calls received by an office on Monday morning between 8:00am and 9:30 am has a mean of 3.Calculate the probability of getting no more than 3 calls between eight and nine in the morning. During May, Carolan Corporation transferred $59,000 from Work in Process to Finished Goods and recorded a Cost of Goods Sold of $65,000. The journal entries to record these transactions would include a: Multiple Choice credit to Cost of Goods Sold of $65,000. debit to Finished Goods of $65,000. credit to Work in Process of $59,000. credit to Finished Goods of $59,000. Why was the result of the election of 1876 controversial? A)An election commission, not the popular or electoral vote, decided the election.B)Hayes won the majority of electoral votes, but Tilden won the popular vote. C)The Supreme Court decided the election after one states results were unclear. D)Tilden won the popular and electoral votes, but Congress decided to elect Hayes. Find the volume of the pyramid shown. A white heron click on the best question to ask before reading the rest of the passage 2. The formation of male and female sex cells is known asA) gametogenesisB) buddingC) sporulationD) regeneration X=5 then 3x + 2 =Pls help I don't know The process of becoming a citizen of a country is know as? Jacqui likes to travel to the beach on weekends. She starts at her house, drives d miles, and then spends t hours walking the remaining w miles to get to the beach. Jacqui drives three times as long as she walks during the trip. The equation below represents Jacqui's average speed, a, in miles per hour, when traveling to the beach. a=d+w/3t+t What is the meaning of 3t + t3t+t in the equation above? -The total time that Jacqui spends traveling to the beach -The time that Jacqui spends driving to the beach -The total distance that Jacqui travels to the beach -Jacqui's maximum speed during her trip Jacqui's average speed during one trip to the beach was 3636 miles per hour. If Jacqui drove 70 miles and the entire trip to the beach took her 22 hours, how many miles did she walk to get to the beach? if x= 3-2^2 then find the value of x^2+1x^2 What is the sign of -x/-y when x > 0 and y > 0? most of the earths earthquakes occur around