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
alisha [4.7K]
3 years ago
6

Define a function setheight, with int parameters feetval and inchesval, that returns a struct of type heightftin. the function s

hould assign heightftin's data member feet with feetval and inches with inchesval.
Computers and Technology
1 answer:
devlian [24]3 years ago
4 0

It is given that the feetVal and inchesVal are parameters of the SetHeight() function. Since the return type of the function is structute, so we need to define a structure.

After that, we need to create a structure variable within the function definition. Now, assign the feet and inches with the feetVal and inchesVal respectively. Finally return the structure variable.

Further explanation:

#include<stdio.h>

//define the structure

typedef struct HeightFtIn_struct {

int feet;

int inches;

} HeightFtIn;

//define the function

HeightFtIn SetHeight(int feetVal, int inchesVal)

{

HeightFtIn Htft; //creating a structure variable of type HeightFtIn

//assign the value of feetVal

Htft.feet = feetVal;  

Htft.inches = inchesVal; //assigning the value of inchesval

//return the structure variable

return Htft;

}

int main(void) {

HeightFtIn studentHeight;

int feet;

 int inches;

printf("Enter the values of feet and the inches: ");

scanf("%d %d", &feet, &inches);

studentHeight = SetHeight(feet, inches);

printf("The student's height is %d feet and %d inches.\n", studentHeight.feet, studentHeight.inches);

return 0;

}

Output:

Enter the values of feet and the inches: 5 9

The student's height is 5 feet and 9 inches.

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. How does coding work on computers?  brainly.com/question/2257971 

Answer details:

Grade: College Engineering

Subject: Computer Science

Chapter: C  Programming

Keyword:

C++, input, output, programming, statements,  loops, if, else, statements, firstname, lastname, base class, derive class, vector, print

You might be interested in
Which of these is system software? Check all
Darya [45]

Answer:

Windows OS is software....

6 0
3 years ago
Which of the following was the first full-length film to be done completely in 3-D imaging
motikmotik
Toy story I believe is the answer
6 0
2 years ago
Read 2 more answers
Distinguish<br> between formal and Informal<br> Information System<br> Information systems
Harlamova29_29 [7]

Explanation:

Formal; A formal information system is based on

the organization represented by the organization chart.

Informal; The informal information system is

employee based system designed

to meet personal and vocational needs

and to help in solution of work-related problems.

5 0
2 years ago
If i find an image and copy and paste it into Paint.
Leokris [45]

Answer:

Lossy image formats will remove data during compression as a trade off for lower storage occupation. Lossless data formats will not remove data during compression, resulting in higher quality but also higher storage occupation.

Graphic Artists will almost always use lossless due to it delivering the highest quality image possible.

8 0
3 years ago
What sentence could Lou’s granddaughter not answer? Explain the context and discuss whether you could answer this question or no
Tanya [424]
He wouldn’t answer the context for the discussion
7 0
2 years ago
Other questions:
  • What is the time period of 1st generation of computer ???
    11·1 answer
  • Oday's color display devices represent color using the ______ color model.â
    13·1 answer
  • Technology offers a variety of rich opportunities available to teachers and students. According to Inan and Lowther (2010), ther
    6·1 answer
  • Movies may depict larger-than-life situations, such as calamities, superheroes, and spaceships. A helps show such extraordinary
    11·1 answer
  • You may see the term FAQ on websites which stands for Frequently Asked Questions this is an example of which type of mnemonic?
    9·1 answer
  • Select the correct answer from each drop-down menu. Look at Marta's email signature and fill in the missing elements. Marta D'Ab
    14·2 answers
  • ________ are the primary means of authentication for a user's computer and other networks and servers to which the user may have
    10·1 answer
  • You are interested in buying a laptop computer. Your list of considerations include the computer's speed in processing data, its
    11·1 answer
  • Positive use of the technology before the pandemic.
    8·1 answer
  • You cannot then move and resize the control on the form as desired with your mouse TRUE OR FALSE​
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!