Pages

Thursday, June 16, 2016

C Program to demonstrate use of logical OR operator


#include<stdio.h>
int main()
{
int a, b;

printf("Enter number a:");
scanf("%d",&a);

printf("Enter number b:");
scanf("%d",&b);

if(a > 0 || b > 0)
{
printf("Evaluation of a>0 OR b>0 is True");
}
else
{
printf("Evaluation of a>0 OR b>0 is False");
}
return 0;
}

Output of program

Enter number a:5
Enter number b:-5
Evaluation of a>0 OR b>0 is True

No comments:

Post a Comment