Function of clrscr() :
- clrscr() Function is used to clear the Previous Output.
- clrscr() Stands For Clear Screen.
- clrscr() Function is included in the <conio.h> Header File.
- clrscr() functions Terminates with the semicolon ( ; ).
#include<stdio.h>
#include<conio.h>
void main()
int number;
clrscr();
printf(" Enter the value of Number\n");
scanf("%d" ,&number);
if (number > 0)
{
printf(" Number is Positive");
}
else
{
printf(" Number is Negative");
}
getch();
}
Output2:
Enter the value of Number
5
Number is Positive
Output2:
Enter the value of Number
-8
Number is Negative
0 Response to "Write a C Program to Check a Number Positive or Negative by using if Statement"
Post a Comment