Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
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"
);
}
}
}
Opeartors
C programming
Up Next
Concept of Logical Operators in C program Example