Computer Science, asked by vigneshkumar132000, 11 months ago

c program to generate numbers between 1 and 100 which are divisible by 2 and are not divisible by 3 and 5

Answers

Answered by abhishekachuks
9

Answer:

Explanation:

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();  

}

Answered by pmanisharma27
7

Answer:

include<studio.h>

#include<conio.h>

main( )

{

int i;/*looping variable

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

{

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

{

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

}

}

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

getcha( ) ;

}

Similar questions