Quantcast

A community for students.

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

timtimi

  • 2 years ago

I have a problem in c++ : i should read a vector from the keyboard for example v=(2,4,8,25,3,66) and after this i should display another vector that contains the numbers 4 and 25 because 4=2*2 and 25=5*5 .

  • This Question is Closed
  1. Shadowys
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    i.e. you want to use the cin to get input and a function that tests if the number is a square of another number?

  2. Shadowys
    • 2 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    this is an example for an array. #include <iostream> using namespace std; int main() { int list[]={6,7,8,9}; int i,j; for (i=0;i<4;i++) { for (j=0;j<list[i];j++) { if (j*j==list[i]) { cout<<list[i]<<"-->"<<j<<"F\n"; } } } }

  3. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.