/*Before seeing the code solution make sure that you have tried enough. Don’t copy- paste the whole code. Find out the logic. If you face any trouble, just inform me in comment.*/
#include<stdio.h>
main()
{
int x,y,i;
scanf("%d%d",&x,&y);
if(x>y)
{
for(i=y+1;i<x;i++)
{
if(i%5==2||i%5==3)
printf("%d\n",i);
}
}
else if(y>x)
{
for(i=x+1;i<y;i++)
{
if(i%5==2||i%5==3)
printf("%d\n",i);
}
}
return 0;
}
//Happy_Coding
#include<stdio.h>
main()
{
int x,y,i;
scanf("%d%d",&x,&y);
if(x>y)
{
for(i=y+1;i<x;i++)
{
if(i%5==2||i%5==3)
printf("%d\n",i);
}
}
else if(y>x)
{
for(i=x+1;i<y;i++)
{
if(i%5==2||i%5==3)
printf("%d\n",i);
}
}
return 0;
}
No comments:
Post a Comment