C Programming Language Tutorial – Lecture 7 Operators in C part 2

This tutorial explains relational and comparison, logical, bitwise and ternary operators.

Our YouTube Channel

Lecture 6 Simple Interest Program

// Source Code

#include<stdio.h>

int main(){

//Comparison operator
printf("%d\n",3>4);
//Prints 0 since statement is false

//logical OR operator
printf("%d\n",1 || 0);

//Right Shift operator
printf("%d\n",4>>1);

//Ternary operator
printf("%d\n",3==4?1:0);

return 0;

}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s