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
arlik [135]
2 years ago
8

Write a program that defines a type for a structure that stores information on a student in ENG EK 125. Declare two variables to

be this structure type, and call a function to initialize both of the structure variables, using call-by-reference.
Computers and Technology
1 answer:
Mashcka [7]2 years ago
8 0

Answer:

Following are the program in the C Programming Language.

#include<stdio.h> //header file

#include<string.h> //header file

struct student//creating structure

{

 //set integer variables

int marks;

int roll;

};

//define function

void initial(struct student *stu)

{

 //set integer type variables

int marks=420;

int roll_no=45,i;

stu->marks=marks;//assigning the values

stu->roll=roll_no;//assigning the values

}

//define main method to call the function

int main()

{

struct student stu;

initial(&stu);//calling the function

printf("Total marks : %d\n",stu.marks); //print output

printf("Roll No. : %d\n",stu.roll); //print output

return 0;

}

<u>Output:</u>

Total marks : 420

Roll No. : 45

Explanation:

Here, we define the structure "student" with a struct keyword for creating a structure.

  • inside the structure, we set two integer type variable "marks", "roll".

Then, we define a function "initial()" and pass an argument in the parameter of the function.

  • inside the function, we set two integer type variable "marks", "roll_no" and assign the value in the variable "marks" to 420 and variable "roll_no" to 45.
  • Assign the value in the structure's integer variables from the function's variable.

Finally, we set the main method inside it we call the function "initial()" and pass the value and then, we print the output with message.

You might be interested in
Why are computer manufacturers constantly releasing faster computers? how do computer users benefit from the increased speed?
Anastaziya [24]
<span>As programs and online activities have grown more robust and innovative, it has simultaneously required computer manufacturers to identify ways to make their devices faster to keep up with these changes. Users benefit immensely due to their ability to have boundless and efficient access to their various needs.</span>
8 0
1 year ago
A BCD code is being transmitted to a remote receiver. The bits are A3, A2, A1, and A0, with A3as the MSB. The receiver circuitry
NARA [144]
<span>BCD only goes from digit 0 (0000) to digit 9 (1001), because for 10 you need two digits, so all you've got to do is make a function that produces high for numbers from 10 (1010) to 15 (1111) as follows:
A3 A2 A1 A0   F
 0    0    0    0    0
 0    0    0    1    0
 0    0    1    0    0
 ...........................
 1    0    0    0    0
 1    0    1    0    1
 1    0    1    1    1
 1    1    0    0    1
 1    1    0    1    1
 1    1    1    0    1
 1    1    1    1    1
 
Then simplify the function: F = A3*A2 + A3*A1 Finally just draw or connect the circuit using NAND</span>
3 0
1 year ago
Write a program to read-in a sequence of integers from the keyboard using scanf(). Your program will determine (a) the largest i
Natali [406]
It’s not letting me answer it
3 0
1 year ago
Suppose that the data mining task is to cluster points (with (x, y) representing location) into three clusters, where the points
solong [7]

Answer:

Explanation:

K- is the working procedure:

It takes n no. of predefined cluster as input and data points.

It also randomly initiate n centers of the clusters.

In this case the initial centers are given.

Steps you can follow

Step 1. Find distance of each data points from each centers.

Step 2. Assign each data point to the cluster with whose center is nearest to this data point.

Step 3. After assigning all data points calculate center of the cluster by taking mean of data points in cluster.

repeat above steps until the center in previous iteration and next iteration become same.

A1(4,8), A2(2, 4), A3(1, 7), B1(5, 4), B2(5,7), B3(6, 6), C1(3, 7), C2(7,8)

Centers are X1=A1, X2=B1, X3=C1

A1 will be assigned to cluster1, B1 will be assigned to cluster2 ,C1 will be assigned to cluster3.

Go through the attachment for the solution.

5 0
2 years ago
What is one major structural difference between a decision structure (such as a decoder) and a storage structure (such as an RS
Andrej [43]

Answer:

B. The storage structure requires a clock input.

Explanation:

Logic circuits are circuits in electronics that give output based on the logic gate principle and its inputs. It can be a sequential logic circuit or a combinational logic circuit.

Decoders RS latches are combinational logic circuits because they both comprise of a combination of several sequential circuits to make their systems. The difference between decoders and RS latches is that the RS is a storage structure which is made up of flip-flops which require a clock input

8 0
1 year ago
Other questions:
  • Instructions:Type the correct answer in the box. Spell all words correctly.
    5·2 answers
  • What is the output of 1101 x 10 == 11000 + 10?
    12·1 answer
  • A slide contains three text boxes and three images that correspond to the text boxes. Which option can you use to display a text
    5·2 answers
  • Susan needs to change the color scheme in all the slides of her multimedia presentation. The presentation software program Susan
    10·2 answers
  • Suppose that a 10-mb file is stored on a disk on the same track (track 50) in consecutive sectors. the disk arm is currently sit
    13·1 answer
  • Who is currently using which computer at WP? Create an appropriate SQL query to answer this question. Show SerialNumber, Make, a
    7·1 answer
  • This exercise shows why each pivot (in eli1nination by pivoting) must be in a different row. (a) In Example 7, make the third pi
    15·1 answer
  • For any element in keysList with a value greater than 60, print the corresponding value in itemsList, followed by a semicolon (n
    14·2 answers
  • Translate the following MIPS code to C. Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3
    8·1 answer
  • Match the following technologies with their applications.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!