Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people's questions, and connect with other people.

Have an account? Sign In
Continue with Facebook
Continue with Google
or use

Have an account? Sign In Now

Sign In

Continue with Facebook
Continue with Google
or use

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Continue with Facebook
Continue with Google
or use

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

Ansfind

Ansfind Logo Ansfind Logo Ansfind Logo Ansfind Logo
Add question

Ansfind Navigation

  • About Us
  • Groups
    • Add group
Search
Add Question

Mobile menu

Close
Ask a Question
  • Home
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Hot Questions
  • Polls
  • Tags
  • Points
  • Users
  • FAQs
  • Help
  • Contact Us
Home/ Questions/Q 9395
Answered
SaRa
SaRaProfessor
Asked: September 8, 20212021-09-08T13:01:33+05:30 2021-09-08T13:01:33+05:30In: Education and learning

If we stored five elements or data items in an array, what will be the index address or the index number of the array’s last data item?

If we stored five elements or data items in an array, what will be the index address or the index number of the array’s last data item?
A) 8
B) 4
C) 5
D) 2

c++
  • 2
  • 22
  • 656
  • 0
  • Share
    • Share on Facebook
    • Share on Twitter
    • Share on LinkedIn
    • Share on WhatsApp
Answer
  • Report

2 Answers

  • Voted
  • Oldest
  • Recent
  1. [Deleted User]
    2021-09-08T16:06:01+05:30Added an answer on September 8, 2021 at 4:06 pm

    Answer: Option B) 4

    The array uses the contiguous block of memory for storing the data elements. Hence the data items pushed into an array are stored at the continuous address space. The index number of the array begins with zero so, the first data item pushed into the array will be stored at zero and so on. Hence index number of the last (fifth) element will be 4.

    Hence the answer is option B) 4

    • 4
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
  2. Best Answer
    Meshtha Programmer
    2022-06-25T14:14:21+05:30Added an answer on June 25, 2022 at 2:14 pm

    Answer: B) 4.

    Explanation:

    In an array, we have to store elements or data array index starting from 0(zero).

    so 5 elements mean we store like this

    int arr[] ={1,2,3,4,5}

    arr[0]=1,

    arr[1]=2,

    arr[2]=3,

    arr[3]= 4,

    arr[4]=5.

    arr[index] = value ends with 4.

     

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report
Leave an answer

Leave an answer
Cancel reply

Choose from here the video type.

Put Video ID here: https://www.youtube.com/watch?v=sdUUx5FdySs Ex: "sdUUx5FdySs".

Related Questions

  • Explain the following methods of string class with syntax and example : (i) substring() (ii) replace()
  • What is the difference between a char in C/C++ and char in Java?
  • Which of the following is example of iteration in c?
  • What are copy constructors in C++?
  • What is the difference between Shallow copy and Deep copy?
  • What arithmetic operators cannot be used with strings?
  • Why Every programmer should learn C++ during their careers?
  • What is call by value and call by reference in c?
  • Bitwise operators can operate upon?
  • Which of the following are tokens in C?

Sidebar

Top Users

Janeclarizz Belmores

Janeclarizz Belmores

  • 3,723 Points
SaRa

SaRa

  • 3,388 Points
Professor
Wish Lay

Wish Lay

  • 2,610 Points

Adv 250x250

  • About Us
  • Home
  • Communities
  • Tags
  • Points
  • Users
  • Help
  • Contact Us
  • Referrals
  • Policies
    • Privacy policy
    • Terms of use
Revenue

© 2023 Ansfind. | Designed by Weboptify

monetization_on Earn home Home
search Search
help Add

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.