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
Phantasy [73]
3 years ago
13

Given the code segment below, complete the assignments as stated in the comments. struct aaa { int m; int nn; } struct bbb{ stru

ct aaa myfield; int sum; } struct bbb myvar; // write one statement to place the integer value 44 into the field sum of structure variable myvar . // write one statement to place the integer value -17 into the field nn of structure variable myvar .
Computers and Technology
1 answer:
grin007 [14]3 years ago
6 0

Answer:

  1. using namespace std;
  2. struct aaa {
  3.    int m;
  4.    int nn;
  5. };
  6. struct bbb{
  7.    struct aaa myfield;
  8.    int sum;  
  9. };
  10. struct bbb myvar;
  11. int main()
  12. {
  13.    myvar.sum =44;
  14.    myvar.myfield.nn = -17;
  15.    
  16.    cout<<myvar.sum<<"\n";
  17.    cout<<myvar.myfield.nn<<"\n";
  18.    return 0;
  19. }

Explanation:

Given two data structures (Line 2-9), we can set the value of 44 to field of sum structure variable myvar by using a dot syntax

                      myvar.sum = 44

To assign value to field of nn of structure in myvar, we need to access the myfield of myvar and then followed by nn. Hence, the statement shall be

                     myvar.myfield.nn = -17

In short the we can always use the dot syntax the access the value of an inner field of a particular data structure.

You might be interested in
__________ is the brain of a computer.<br><br> A. Hardware<br> B. CPU<br> C. Memory<br> D. Disk
iren [92.7K]

Answer:

The CPU is the brain of a computer

8 0
3 years ago
Read 2 more answers
What is the output, if userVal is 5? int x; x = 100; if (userVal != 0) { int tmpVal; tmpVal = x / userVal; System.out.print(tmpV
spayn [35]

Answer:

The output is 20

Explanation:

This line divides the value of x by userVal

tmpVal = x / userVal;

i.e.

tmpVal = 100/5

tmpVal = 20

This line then prints the value of tmpVal

System.out.print(tmpVal);

i.e 20

Hence, The output is 20

4 0
3 years ago
What option is used to combine several objects so that they can be treated as a single unit
elixir [45]
Im gonna hope this is a coding question.
It's parent (unit) and make children (objects)

If it's word/excel give me the multiple choice answers please.
6 0
3 years ago
Write a program whose inputs are three integers, and whose outputs are the largest of the three values and the smallest of the t
Monica [59]

Answer:

int SmallestNumber(int num1, int num2, int num3){

int smallest;

if (num1 >num2){

smallest=num2;

}

else {

smallest=num1;

}

if(smallest <num3){

smallest=num3;

}

}

int LargestNumber(int num1, int num2, int num3){

int largest;

if (num1 <num2){

largest=num2;

}

else {

largest=num1;

}

if(largest>num3){

largest=num3;

}

}

void main(){

int num1,num2,num3;

printf("enter values");

scanf("%d%d%d",&num1,&num2,&num3);

int smallest=SmallestNumber(num1,num2,num3);

int largest=LargestNumber(num1,num2,num3);

}

Explanation:

we are comparing first two numbers and finding largest among those. After getting largest comparing that with remaining if it is greater then it will be largest of three. Same logic applicable to smallest also

7 0
3 years ago
How can we use sprites to help us keep track of lots of information in our programs?
DIA [1.3K]

Explanation:

what kind of sprites do you mean?

8 0
3 years ago
Other questions:
  • Which of the following can be both an input device and an output device? mouse. keyboard. display screen. laser printer .
    9·1 answer
  • When encountering another vessel in darkness or reduced visibility, what do visible red and green lights indicate
    9·1 answer
  • 5. Write a 500- to 1,000-word description of one of the following items or of a piece of equipment used in your field. In a note
    13·1 answer
  • Https://intro.edhesive.com/courses/17288/assignments/2313298?module_item_id=4864185
    9·1 answer
  • How to change the size of my document in cs6?
    13·1 answer
  • 1.Anong uri ng application software ang iyong ginamit upang makapagtutuos ka ng datos?
    15·1 answer
  • Which Tab provides the command to add a hyperlink to a document?
    11·2 answers
  • It is a type of web page that allows you to share your ideas experiences and beliefs
    9·1 answer
  • Not every design choice in your game interface requires having a thought process behind it.
    9·2 answers
  • When companies charge different prices for the same product, they're using
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!