Computer Science, asked by chinthakumari8127, 2 months ago

write a c program to find given number is positive or negative​

Answers

Answered by MrTSR
4

C Program to check whether a number is positive or negative.

#include <stdio.h>

int main()

{

   int num;

printf("Enter the number: ");

scanf("%d", &num);

if (num > 0)

 {

printf("Num is Positive");

  }

else if (num < 0)

{

printf("Num is Negative");

}

return 0;

}

Example Output :

Enter the number: 10

Num is Positive

Attachments:
Similar questions