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

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

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

You must login to ask a question.

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

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8346317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:58:24+00:00 2026-06-09T06:58:24+00:00

Can you help me with a problem on populating an array of 5 circles

  • 0

Can you help me with a problem on populating an array of 5 circles with random numbers.
The random number would be the radius of the circles.
Here is my code:

#include <iostream>
#include <time.h>
using namespace std;

int main()
{
    // Array 2, below section is to populate the array with random radius
    float CircleArrayTwo [5]; // store the numbers
    const int NUM = 5; // Display 5 random numbers

    srand(time(NULL)); // seed the generator

    for(int i = 0; i < NUM; ++i)
    {
        CircleArrayTwo[i] = rand()%10;
    }

    cout << "Below is the radius each of the five circles in the second array. " <<   endl;
    cout << CircleArrayTwo << endl;

    system("PAUSE");
    return 0;
}

Currently is output the following:

Below is the radius each of the five circles in the second array.
002CF878

Where am I going wrong?

Any help is much appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:58:26+00:00Added an answer on June 9, 2026 at 6:58 am

    You are printing the address of the first element of the array.
    You could loop over the array and print each element:

    for(int i = 0; i < NUM; ++i)
    {
        std::cout << CircleArrayTwo[i] << ", ";
    }
    std::cout << "\n";
    

    Or, if you have C++11 support,

    for (auto& x : CircleArrayTwo) {
       std::cout << x << ", ";
    }    
    std::cout << "\n";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Who can help me to fix the following problem? Here is the issue: in
I've got a problem with populating an edittext. Using the following code i can
Maybe you can help me with a problem I am having. The URL of
Hope someone can help me out with this problem I am having. I just
Perhaps any of you can help me with this anoying problem. I have long
I am hoping someone can help me with a css problem... I am using
This problem is very strange and I'm hoping someone can help me. For the
I'm hoping someone can help me as I've been stuck on this problem for
I have a problem with preg_match_all that maybe you can help. I have a
i have very serious problem if any tech expert can help...thank you in advance..

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

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.