How many non prime numbers less than 200 not divisible by 2,3,4,7,8,9,12?
Answers
Answer:
#include < stdio.h>
int main ( )
{
int i, j, x ;
for ( i = 1, i<= 200 ; i++ )
if ( i % 2 =! 0 && i % 3 =! 0 && i % 4 =! 0 && i % 7 =! 0 && i % 8 =! 0 && i%9=!0 && i % 12 =! 0 )
{
x = i / 2;
for ( j=2; j <= x ; j++ )
{
if ( i % j == 0 ) // condition for checking non prime numbers
{
printf ( "%d ", i ) // it prints non prime numbers which are not . divisible by 2,3,4,7,8,9,12 //
return 0 ;
} // end of main
Step-by-step explanation:
prime numbers are those numbers which are only divisible by itself and 1 but not other numbers.
here main() is the function. and printf is used for print a message.
above program prints the all non prime numbers which are not divisible by 2,3,4,7,8,9,12