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
wariber [46]
3 years ago
11

Write a function which multiplies the values in odd position values by 10. Odd positions in this case refers to the first value

in the list, the third value, the fifth value etc
Engineering
1 answer:
xxMikexx [17]3 years ago
5 0

Answer:

Using linkedlist on C++, we have the program below.

Explanation:

#include<iostream>

#include<cstdlib>

using namespace std;

//structure of linked list

struct linkedList

{

  int data;

  struct linkedList *next;

};

//print linked list

void printList(struct linkedList *head)

{

  linkedList *t=head;

 

  while(t!=NULL)

  {

      cout<<t->data;

      if(t->next!=NULL)

      cout<<" -> ";

     

      t=t->next;

  }

}

//insert newnode at head of linked List

struct linkedList* insert(struct linkedList *head,int data)

{

  linkedList *newnode=new linkedList;

  newnode->data=data;

  newnode->next=NULL;

 

  if(head==NULL)

  head=newnode;

  else

  {

      struct linkedList *temp=head;

      while(temp->next!=NULL)

      temp=temp->next;

     

      temp->next=newnode;

     

      }

  return head;

}

void multiplyOddPosition(struct linkedList *head)

{

  struct linkedList *temp=head;

  while(temp!=NULL)

  {

      temp->data = temp->data*10; //multiply values at odd position by 10

      temp = temp->next;

      //skip odd position values

      if(temp!= NULL)

      temp = temp->next;

  }

}

int main()

{

  int n,data;

  linkedList *head=NULL;

 

// create linked list

  head=insert(head,20);

  head=insert(head,5);

  head=insert(head,11);

  head=insert(head,17);

  head=insert(head,23);

  head=insert(head,12);

  head=insert(head,4);

  head=insert(head,21);    

 

  cout<<"\nLinked List : ";

  printList(head); //print list

 

  multiplyOddPosition(head);

  cout<<"\nLinked List After Multiply by 10 at odd position : ";

  printList(head); //print list

 

  return 0;

}

You might be interested in
Asperities are microscopic peaks and valleys on
Rudiy27

Answer:

On a surface.

Explanation:

Asperities are microscopic peaks and valleys on a surface. This simply means that, when asperities contacts, surfaces also make contact. Asperities are the roughness or unevenness of a surface coming in contact during wear or friction.

8 0
3 years ago
Read 2 more answers
12. Which of the following letter doesn't still the same when its viewed
Mashcka [7]

Answer:

the correct answer is option B. W

3 0
3 years ago
Read 2 more answers
An office worker claims that a cup of cold coffee on his table warmed up to 80°C by picking up energy from the surrounding air,
kherson [118]

Answer:

The claim is false and violate the zeroth law of thermodynamics.

Explanation:

Zeroth law of thermodynamics refers to thermal equilibrium among  elements. It states that  elements which different temperatures will reach the same temperature at the endgame if they are close enough to interact each other. This temperaure is called <em>equilibrium temperature and it is always a intermediate value between the element with highest temperature and the element with the lowest one. So there is no way </em> a cup of cold coffee on a table can warm up to 80°C picking up energy from the surrounding air at 25°C because the cup can only reach a temperature closer to the surrounding air temperature which will be the equilimbrium temperature for that case.

4 0
3 years ago
Read 2 more answers
This test should be performed on all cord sets, receptacles that aren't part of a building or structure's permanent wiring, and
vova2212 [387]

Answer:

A continuity test

Explanation:

A continuity test is used to verified that current will flow in an electrical circuit, it performed by placing a small voltage across the chosen path. continuity test ensure that the equipment grounding conductor is electrically continuous and this test is perform on all the cord sets, receptacles that aren't part of a building or structure's permanent wiring, and cord-and-plug connected equipment required to be grounded. example of equipment used in testing current flow in continuity test are Analog multi-meter, voltage/continuity tester etc.

Continuity test and terminal connection test are the two test required by OSHA on all electrical equipment

8 0
3 years ago
The principal component in glass manufacturing is_____
Oksanka [162]

Answer:

Silica is the principal component in glass.

Explanation:

Step1

Glass is the amorphous solid and transparent. Glass products have many of the shapes and design that are available in market.

Step2

Natural quartz is the primary source of glass in sand. Silica is the principal component in approximately all glass. Lime stone, soda ash and aluminum oxide are added in the galas for desired properties depending upon application. So, silica is the principal component in glass.

5 0
4 years ago
Other questions:
  • Work-producing devices that operate on reversible processes deliver the most work, and work-consuming devices that operate on re
    6·1 answer
  • What is the thermal efficiency of a gas power cycle using thermal energy reservoirs at 627°C and 60°C? The thermal efficiency is
    12·1 answer
  • The elastic settlement of an isolated single pile under a working load similar to that of piles in the group it represents, is p
    8·1 answer
  • a triangle is defined by the three vertices. write the following functions of the triangle class assume that the point class has
    7·1 answer
  • A spherical interplanetary probe of 0.5-m diameter contains electronics that dissipate 150 W. If the probe surface has an emissi
    11·1 answer
  • Charles, Clarissa, and Francine all work in Manufacturing. The table shows the breakdown of one day for each employee.
    5·2 answers
  • The rate of flow through an ideal clarifier is 8000m3 /d, the detention time is 1h and the depth is 3m. If a full-length movable
    5·1 answer
  • The dc machine of Problem 7.4 is to be operated as a motor supplied by a constant armature terminal voltage of 250 V. If saturat
    13·1 answer
  • A. Imagine the white car in the left lane is moving more slowly than the surrounding traffic. How is this a violation of a state
    7·2 answers
  • What part connect to the tie rod that helps the brake chamber out that deals with slack adjuster
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!