C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Concept of Logical Operators in C program Example
WhatsApp
Krishna Rajput Singh
Aug 21
2015
1.3
k
0
1
#include<stdio.h>
#include<conio.h>
main()
{
int
a,b,c;
// local variable assign
printf(
"Enter the number of a\n"
);
printf(
"Enter the number of b\n"
);
printf(
"Enter the number of c\n"
);
scanf(
"%d"
,&a);
scanf(
"%d"
,&b);
scanf(
"%d"
,&c);
if
(a>b || a>c)
// using OR operator if any one condition is true print if statement otherwise else print.
{
printf(
"a is greater number\n"
);
}
else
printf(
"b and c are greater number of a\n"
);
{
if
(b>c && b>a)
// using AND operator if both condition are true then print if statement otherwise else print.
{
printf(
"b is greater number\n"
);
}
else
printf(
"a & c are greater number of b\n"
);
{
if
(c>a != c>b)
// using NOT no full-fill any condition always print false like else statement.
{
printf(
"c is greater number\n"
);
}
else
printf(
"a & b are greater number of c\n"
);
}
}
}
C programming
Opeartors
Up Next
Concept of Logical Operators in C program Example