Code for PROGRAM FOR Y = 1 IF X > 0 Y = 0 IF X = 0 Y = -1 IF X < 0 in C Programming
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
int x,y;
clrscr();
printf("Enter the value of x :: ");
scanf("%d",&x);
if(x > 0)
printf("Value of y is :: 1");
if(x == 0)
printf("Value of y is :: 0");
if(x < 0)
printf("Value of y is :: -1");
getch();
}
/*
********
OUTPUT
********
Enter the value of x :: 23
Value of y is :: 1
*/