Thread: Quick question - basic mistake probably

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    May 2006
    Location
    Berkshire, UK
    Posts
    29
    Ummmm... you are still not there.
    Your for loop will fail (or at least it should do). the condition part is not valid, you are assigning the value 13... to (x*y) which you cannot do and don't want to anyway.

    try starting from the following position and you will be on the way:
    Code:
    for(x=2; x<=13... /2;x++)
    {  for(y=2;x*y<13...;y++);
         
    }
    or you could just go through dividing by x and seeing if there is a remainder... using the % operator.
    Code:
    for(x=2; x<=13... /2;x++)
    {  if((13... % x)==0)
       etc...

    Not sure if there is a 'required' approach.
    Last edited by michaels-r; 06-22-2006 at 03:21 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. basic question about global variables
    By radeberger in forum C++ Programming
    Replies: 0
    Last Post: 04-06-2009, 12:54 AM
  2. Quick Question, Basic Programing
    By brian75 in forum C++ Programming
    Replies: 2
    Last Post: 12-16-2008, 08:14 PM
  3. Quick question about types...
    By Elysia in forum C++ Programming
    Replies: 32
    Last Post: 12-07-2008, 05:39 AM
  4. Questions on basic Quick Sort
    By Weng in forum C++ Programming
    Replies: 4
    Last Post: 12-16-2003, 10:06 AM
  5. Quick question: exit();
    By Cheeze-It in forum C Programming
    Replies: 6
    Last Post: 08-15-2001, 05:46 PM