Home » NO IDEA » C program to generate numbers between 20 and 100 which are divisible by 2 and not divisible by 3 and 5

C program to generate numbers between 20 and 100 which are divisible by 2 and not divisible by 3 and 5

Blog Stats

  • 13,912 hits
December 2013
M T W T F S S
« Oct   Jan »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

/*Write a C program to generate numbers between 20 and 100 which are
divisible by 2 and not divisible by 3 and 5*/
#include<stdio.h>
int main()
{
int i,n;
for(i=20;i<100;i++)
{
n=i;
if((n%2==0)&&(n%3!=0)&&(n%5!=0))
{
printf("\n the values are %d",n);
}
}
return 0;
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: