0
How to recognize positive or negative numbers with c language?
Please write a code that determines that the user's number is positive or negative or zero, please write with C
1 Odpowiedź
+ 10
● greater than 0 is +ve & less than 0 is negative[ 0 is not +ve, nor -ve]
● scanf() method to take user input .
//here is the rough code :
#include <stdio.h>
int main() {
int a;
scanf("%d", &a);
if (a>0)
printf("postive");
else if (a <0)
printf("negative");
return 0;
}