#include <stdio.h>
#include <conio.h>
void main()
{
clrscr();
int m, n;
printf("enter a value of a: ");
scanf("%d", &m);
if (m != 0) // true
{
if (m > 0) // true
{
n = 1;
}
else
{
n = -1;
}
}
printf("the value of m is %d\n", m);
printf("the value of n is %d\n", n);
getch();
}
OUTPUT
Enter a value of a: 10
The value of m is 10
The value of n is 1
0 Comments