Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/
#include <stdio.h>
int main()
{
int a,b;
while(1)
{
scanf("%d%d", &a, &b);
if(a==0 || b==0)
break;
else if(a>0 && b>0)
printf("primeiro\n");
else if(a>0 && b<0)
printf("quarto\n");
else if(a<0 && b<0)
printf("terceiro\n");
else if(a<0 && b>0)
printf("segundo\n");
}
return 0;
}
Why use 1 in while condition??
ReplyDelete