InterviewSolution
| 1. |
Write a program to enter a number and check whether the number is negative or not.Correct answer will be marked as brainliest. |
|
Answer» Answer: Write a C program to check positive, negative or zero using SIMPLE if or if else. C program to input any number from user and check whether the given number is positive, negative or zero. Logic to check negative, positive or zero in C programming. Example Input Input number: 23 Output 23 is positive OR Positive or Negative Using if...else #include INT main() { double num; printf("ENTER a number: "); scanf("%lf", &num); if (num <= 0.0) { if (num == 0.0) printf("You entered 0."); else printf("You entered a negative number."); } else printf("You entered a positive number."); RETURN 0; } Explanation: mark me brainliest it is correct |
|