Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- float x,y;
- printf("Enter the value of x: ");
- scanf("%f",&x);
- if(x>0)
- printf("y = 1");
- if(x <= 0)
- {
- if(x==0)
- printf("y = 0");
- if(x!=0)
- {
- if (x<0)
- printf("y = -1");
- }
- }
- }
- //Output
- //Enter the value of x: 0
- //y = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement