#include<stdio.h> int main(void) { int x,y; printf("Enter x: "); scanf_s("%d",&x); if(x<0){ y = -1; } else if(x==0){ y=0; } else{ y=1; } printf("y=%d ",y); return 0; }
#include<stdio.h> int main(void) { int x,y; printf("Enter x: "); scanf_s("%d",&x); if(x<0){ y = -1; } else if(x==0){ y=0; } else{ y=1; } printf("y=%d ",y); return 0; }