filmov
tv
Relational Operators in C - C Programming Tutorial 24
Показать описание
Notes for You:: Relational Operators in C - C Programming Tutorial 24
- are also known as comparison operators.
- are used to compare the relationship between two values.
- on comparison they yield the result either 0 or 1.
Note:
- In C 0 indicates FALSE and any non zero value indicates TRUE.
There are 6 Relational Operators in C; they are:
< : less than
> : greater than
<= : less than or equal to
>= : greater than or equal to
== : equal to
!= : not equal to
Example Code:
#include <stdio.h>
int main()
{
printf("%d\n",3<4); // 1
printf("%d\n",5<4); // 0
printf("%d\n",5>4); // 1
printf("%d\n",5>6); // 0
printf("%d\n",5<=6); // 1
printf("%d\n",6<=6); // 1
printf("%d\n",7<=6); // 0
printf("%d\n",7>=6); // 1
printf("%d\n",7>=7); // 1
printf("%d\n",7>=8); // 0
printf("%d\n",7==8); // 0
printf("%d\n",7!=8); // 1
return 0;
}
Note:
- replace < less-than symbol.
- replace > greater-than symbol.
=========================================
Follow the link for next video:
C Programming Tutorial 25 - Logical Operators in C Programming Language
Follow the link for previous video:
C Programming Tutorial 23 - Arithmetic Operators in C Programming Language
=========================================
C Programming Tutorials Playlist:
=========================================
Watch My Other Useful Tutorials:-
Computer Programming Fundamentals Playlist:-
C Practical LAB Exercises Playlist:-
C++ Tutorials Playlist:
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #CProgramming #CProgrammingTutorial
- are also known as comparison operators.
- are used to compare the relationship between two values.
- on comparison they yield the result either 0 or 1.
Note:
- In C 0 indicates FALSE and any non zero value indicates TRUE.
There are 6 Relational Operators in C; they are:
< : less than
> : greater than
<= : less than or equal to
>= : greater than or equal to
== : equal to
!= : not equal to
Example Code:
#include <stdio.h>
int main()
{
printf("%d\n",3<4); // 1
printf("%d\n",5<4); // 0
printf("%d\n",5>4); // 1
printf("%d\n",5>6); // 0
printf("%d\n",5<=6); // 1
printf("%d\n",6<=6); // 1
printf("%d\n",7<=6); // 0
printf("%d\n",7>=6); // 1
printf("%d\n",7>=7); // 1
printf("%d\n",7>=8); // 0
printf("%d\n",7==8); // 0
printf("%d\n",7!=8); // 1
return 0;
}
Note:
- replace < less-than symbol.
- replace > greater-than symbol.
=========================================
Follow the link for next video:
C Programming Tutorial 25 - Logical Operators in C Programming Language
Follow the link for previous video:
C Programming Tutorial 23 - Arithmetic Operators in C Programming Language
=========================================
C Programming Tutorials Playlist:
=========================================
Watch My Other Useful Tutorials:-
Computer Programming Fundamentals Playlist:-
C Practical LAB Exercises Playlist:-
C++ Tutorials Playlist:
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #CProgramming #CProgrammingTutorial
Комментарии