Thread: Coding Hint Help

  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    3

    Coding Hint Help

    Hi,

    I am new to C. I want to write a C program in which I want the following:

    Find a age of a person who is in the range from 21 to 50 yeas of age and have vehicles which are in total a prime number. The number of vehicles is equal to sum of two digits of his age. The first two digits of his zip code is his age, number of vehicles is 3rd digit of zip code and the last 2 digits of zip code is sum of age and vehicles. These last two digits of zip code is power of 2.

    Any suggestions and help appreciated.

  2. #2
    Registered User
    Join Date
    Apr 2011
    Location
    Bangalore
    Posts
    20
    Code:
    for i = 21 to 50
    {
    
    noVech = i/10 + 1%10; if(isprime(noVech) {
    if(noVech<10) {
    checkforpowerof2(i+noVech)
    }
    }

  3. #3
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by ShashiKantSuman View Post
    Code:
    for i = 21 to 50
    {
    
    noVech = i/10 + 1%10; if(isprime(noVech) {
    if(noVech<10) {
    checkforpowerof2(i+noVech)
    }
    }
    So let me see if I get this... you decided you'd respond to a question that's about 1/4 there with code that does nothing of value whatsoever?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by void12 View Post
    Hi,

    I am new to C. I want to write a C program in which I want the following:

    Find a age of a person who is in the range from 21 to 50 yeas of age and have vehicles which are in total a prime number. The number of vehicles is equal to sum of two digits of his age. The first two digits of his zip code is his age, number of vehicles is 3rd digit of zip code and the last 2 digits of zip code is sum of age and vehicles. These last two digits of zip code is power of 2.

    Any suggestions and help appreciated.
    First... Take a look at this board's Homework Policy

    Second... Post your code and ask specific questions about it.

    We don't do people's homework for them and we don't give out free code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I want a hint
    By Dan. in forum C++ Programming
    Replies: 2
    Last Post: 02-11-2011, 03:36 PM
  2. I need a hint.
    By hyrule in forum C++ Programming
    Replies: 4
    Last Post: 09-04-2005, 09:31 PM
  3. hi! could anybody help me, a hint at the least
    By alvarorahul in forum C Programming
    Replies: 1
    Last Post: 07-07-2004, 02:37 AM
  4. Just a HINT
    By Diceman in forum C++ Programming
    Replies: 1
    Last Post: 07-25-2003, 05:27 PM
  5. i need hint...
    By jk81 in forum C Programming
    Replies: 3
    Last Post: 09-12-2002, 08:38 PM