Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

timtimi

  • 3 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
    • 3 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
    • 3 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