Author Topic: Help ?I think i have a logical error and i can't figure it out :(. please help?  (Read 3870 times)


  • Guest
#include <stdio.h>
#include <stdlib.h>

  int is_prime(int i,int j);
  char contains_one(char number);

  int main (){
      int a,b;
      int i;
      int j;

      printf("\nPlease Enter The Value of X And Y To find the prime numbers between them\n");


  return 0;

    int is_prime(int i,int j){
        int number;
        for (i=2<j;i<number/2;i++)
        if(number %i==0){

    char contains_one(char number){

        if (number =='1')
        return number;

a problem to find all the prime numbers between (not including) any two positive integers x and y ( x < y ) and prints to the screen all the prime numbers ( between x and y ) that have the digit 1 (one ) in them. ( i can't figure it out )  using functions

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Unreleted to C::B and therefore violating our forum rules !!

Please ask in an appropriate forum and not on this site.

Topic locked !!