Best Answer

include<stdio.h>

#include<conio.h>

main()

{

int i; /* looping variable */

for(i=1;i<=100;i++) /* goes from 1 to 100 */

{

if((i % 2 == 0) && (i % 3 != 0) && (i % 5 != 0)) /* checks all three conditions */

{

printf("%d ",i); /* note the space after 'd' */

}

}

printf("\nEnd of Program"); /* End */

getch();

}

More answers

Sure, honey. Here's a little code snippet for you:

```
#include <stdio.h>
int main() {
for (int i = 1; i <= 100; i++) {
if (i % 2 == 0 && i % 3 != 0 && i % 5 != 0) {
printf("%d\n", i);
}
}
return 0;
}
```

Run this bad boy and you'll get all those numbers divisible by 2 but not by 3 and 5. Happy coding, sugar!

Q: C program to print 1 to 100 divisible by 2 and not divisible by 3 and 5?

Write your answer...

Submit

Still have questions?

Continue Learning about Other Math

#include<stdio.h> #include<conio.h> void main() { clrscr(); for (int i=1;i<=100;i++) { if(i%2 !=0 && i%3 !=0) { printf("\n Numbers that are not divisible by 2 or 3:%d \n ",i); } printf("\n"); } getch(); }

There are 49 numbers between 1 and 100 that are divisible by two.

The numbers divisible by nine up to a 100 are 9,18,27,36,45,54,63,72,81,90,and,99

4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96, 100

33 numbers between 1 and 100 are divisible by 3.

Related questions

Prime numbers are numbers that are only divisible by themselves and the number 1. You can write a program to print all prime numbers from 1 to 100 in FoxPro.

Write a c program to print the 100 to 1 nos

#include #include#define N 100 /* change the upper limit by changing value of N */int main(){int i;clrscr();printf("\nPROGRAM TO PRINT NUMBERS DIVISIBLE BY 8 between 1 and 100\n");for(i=1;i

#include<stdio.h> #include<conio.h> void main() { clrscr(); for (int i=1;i<=100;i++) { if(i%2 !=0 && i%3 !=0) { printf("\n Numbers that are not divisible by 2 or 3:%d \n ",i); } printf("\n"); } getch(); }

(rand()&50+1)*2

87 is divisible by 1, 3, 29, and 87. 100 is divisible by 1, 2, 4, 5, 10, 20, 25, 50, and 100, therefore the only number divisible by 87 and 100 is 1.

# Ruby code print 'Enter n: '; n = gets.to_i n.times { | i | puts ( i + 1 ) ** 2 if ( i + 1 ) % 3.0 == 0.0 }

There are 98 numbers are between 1 and 100 that are divisible by five.

Multiples of 100.

All integers are evenly divisible by 1.

There are 49 numbers between 1 and 100 that are divisible by two.

Write a program to find the number and sum of all integers from 100 to 300 that are divisible by 11