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
arlik [135]
4 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]4 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
Fourth-generation languages are commonly used to access ____
Nesterboy [21]
Databases use fourth-generation languages in order to access its contents. These fourth-generation programming languages are widely used in database managing. It was designed to have a more specific use in contrast to the commonly used 3G languages at that time. 
6 0
3 years ago
1. You want to find if TCP/IP Services are working properly on your Computer, you would use which command? a. PING LOCALHOST b.
Olegator [25]

Answer:

Option A

Explanation:

Option B is rejected because it is used to get the startup network settings, processes extra features used by the network.

Option C is rejected because it is used to check the stats like ping,fps of the network by using a loop back.

Option A is selected because PING command is used to check the data packets transfer rate between two ends using ICMP protocol. Local host means that you are specifying the one end as your side. If the packets are there then it is working else the IP service is down.

3 0
3 years ago
Sara would like to begin creating macros in Excel 2016. Where can she find the ability to launch the Macro dialog box?
Nadusha1986 [10]

Answer:

C) Developer tab in the Code group

Explanation:

6 0
3 years ago
Read 2 more answers
1.A tachometer measures:
Art [367]
1. D


2. D


I hope I helped :)
3 0
3 years ago
Create a class named TestCircle whose main() method declares Several Circle objects. Using the setRadius() method, assign one Ci
emmainna [20.7K]

Answer:ublic class Circle {

public int radius = 1;

public double diameter;

public double area;

//Constructor for circle class

public double Circle(int First){

return radius;

}

//Start set and get for radius

private double setRadius(int r){

   return radius = 5;

}

private double getRadius(){

 return radius;

}

//Start set and get for diameter

public double setDiamter(double d){

   return diameter = 7;

}

public double getDiamter(){

 return radius * diameter;

}

5 0
3 years ago
Other questions:
  • Theresa is a certified teacher. She just had a baby and would like to stay home, but still wants to teach. Which career would be
    11·2 answers
  • What geek fest convention kicks-off today?
    8·1 answer
  • Write a short program that uses a for loop to write the numbers 1 through 10 to a file
    11·1 answer
  • A palindrome is a word or a phrase that is the same when read both forward and backward. Examples are: "bob," "sees," or "never
    7·1 answer
  • Caleb is working in an Excel spreadsheet and realizes that he incorrectly spelled a word he used in multiple cells. Which can Ca
    7·1 answer
  • A normal HDMI signal has a colour depth of 8 bits per each of RGB colour. The maximum number
    13·1 answer
  • What is the answer ?? plz help
    9·1 answer
  • During critical thinking, the evaluation of information should use
    15·2 answers
  • Describe a situation when you would use a conditional statement in a program. Describe the action that would occur when the cond
    10·1 answer
  • Subscribe to my you tube channel to get all your questions answered
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!