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
Vikki [24]
3 years ago
5

Assume you define a vector in the following way:

Computers and Technology
1 answer:
salantis [7]3 years ago
6 0

Answer:

vec[0].push_back(10)

Explanation:

Given

Declaration: vector <int> vec

Required

Assign 10 to the first element

This can be done using the push_back keyword.

The syntax is:     <em>vectorname[position].push_back(value); </em>

In this case:

vectorname = vec

position = 0 i.e. first element

value = 10

So, we have:

vec[0].push_back(10)

You might be interested in
Suppose a MATV/SMATV (Satellite Master Antenna Television) firm has to start it's operation in the metropolitan area of a countr
Nata [24]
Cdizvwjcuabcusyfbwhcyeiixhw. jai
8 0
4 years ago
What is the term for a problem in your code
Anna71 [15]

Answer:

bug

Explanation:

Bug

a problem in your code

7 0
3 years ago
Read 2 more answers
The Fibonacci sequence {fib}i≥1 is defined recursively as follows: fib(1) = 1, fib(2) = 1 and, fib(n) = fib(n-1) + fib(n-2) for
nadya68 [22]
<h2>Answer:</h2>

// Create a class header definition

public class Fibonacci {

   

   //Create a method fib to return the nth term of the fibonacci series

   public static long fib(int n){

       

       //when n = 1, the fibonacci number is 1

       //hence return 1

       if (n <= 1){

           return 1;

       }

       

       //when n = 2, the fibonacci number is 1

       //hence return 2

       else if(n == 2){

           return 1;

       }

       

       //at other terms, fibonacci number is the sum of the previous two

       //numbers

       //hence, return the sum of the fib on the previous two numbers - n-1

       // and n-2

       else {

           return fib(n-1) + fib(n-2);

       }

       

   }

   

   //Create the main method to test the fib() method

   public static void main(String[] args) {

     

       // Test the fib method with n = 9        

       System.out.println(fib(9));

     

   }

}

=====================================================

<h2>Sample Output:</h2><h2></h2>

34

======================================================

<h2>Explanation:</h2>

The program above has been written in Java and it contains comments explaining each line of the code. Kindly go through the comments.

The actual lines of code are written in bold face to distinguish them from comments.

Also, a sample output of a run of the program has been provided.

4 0
3 years ago
Write a program that keeps taking integers until the user enters in python
soldi70 [24.7K]

int main {

//variables

unsigned long num = 0;

std::string phrase = " Please enter your name for confirmation: " ;

std::string name;

//codes

std::cout << phrase;

std::cin>> name;

while ( serial.available() == 0 ) {

num++;

};

if ( serial.avaliable() > 0 ) {

std::cout << " Thank you for your confirmation ";

};

};

3 0
3 years ago
Giving brainliest for correct answers!
lina2011 [118]

Answer:

true

Explanation:

5 0
3 years ago
Read 2 more answers
Other questions:
  • You have implemented nap with dhcp enforcement, so you need to ensure you have an updated anti-virus software package, an update
    7·1 answer
  • Use a spreadsheet to solve this business problem. The owners of an electronics store want to find which of their products makes
    12·1 answer
  • What width would you choose for the pdf?
    12·1 answer
  • What happens once the Insert tab is used in PowerPoint to insert a chart into a presentation?
    7·1 answer
  • Consider the classes below: public class TestA { public static void main(String[] args) { int x = 2; int y = 20 int counter = 0;
    8·1 answer
  • These icons cannot be removed from the Dock. Finder e-mail music player Trash
    14·1 answer
  • Discuss briefly four types of websites and the criteria you will use to evaluate the content of a website
    8·1 answer
  • What pets are on Terraria and how can you get them?
    15·2 answers
  • IBM’s system that is built on the middle ground approach to AI.
    12·1 answer
  • Dawn is trying to find out how much weight she can push across the room. She is really trying to find her __________. A. flexibi
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!