News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Help ?I think i have a logical error and i can't figure it out :(. please help?

Started by Toto1991, July 11, 2010, 07:32:53 PM

Previous topic - Next topic

Toto1991

#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");
     scanf("%d%d",&i,&j);

     a=is_prime(i,j);
     b=contains_one(a);

 return 0;
}



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

   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

Jenna

Unreleted to C::B and therefore violating our forum rules !!

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

Topic locked !!