The first line will contain a message prompt to input the integer.
The second line contains "Positive" if the integer is positive, or "Negative" if it isn't.
Enter·n:·-12
Negative
#include<stdio.h>
int main(){
int number;
printf("Enter n: ");
scanf("%d",&number);
if(number>=0){
printf("Positive\n");
}else{
printf("Negative\n");
}
scanf("%d",&number);
return 0;
}
Comments
Leave a comment