Language
C
Compiler
gcc 12.1.0
Options
Warnings
C99
-pedantic
Raw compiler options
-lm
#include<stdio.h>
void main(){
float p1,p2;
float *x,*y;
printf("Enter the co-ordinates (x,y) : ");
scanf("%f%f",&p1,&p2);
x = &p1;
y = &p2;
printf("The co-ordinates(%f,%f) lies in quadrant ",*(x),*(y));
if(*x == 0 && *y ==0) {
printf("It is the origin.");
return;
}
if(*x > 0 && *y > 0){
printf("1");
}
else if(*x < 0 && *y > 0){
printf("2");
}
else if(*x < 0 && *y < 0){
printf("3");
}
else printf("4");
return ;
}
114514
-810
$ gcc prog.c -Wall -Wextra -std=c99 -pedantic -lm
Enter the co-ordinates (x,y) : The co-ordinates(114514.000000,-810.000000) lies in quadrant 4
Exit Code:
52