Reality PaperReality Paper
  • Home
  • Business
    • Finance
  • News
  • Technology
    • App Development
    • Web Development
    • Mobile Phones
    • Gaming
    • Social Media
    • Digital Marketing
    • Automation
  • Education
  • Travel
  • Health
  • Sports
  • Food
    • Recipe
  • General
    • Auto-Mobile
    • Real Estate
    • Fashion
    • Life Style
    • Home Improvement
    • Events
    • Featured

Subscribe to Updates

Get the latest creative news from FooBar about art, design and business.

What's Hot

SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK

July 5, 2022

5 Reasons to Get Snow Plowing Solutions

July 5, 2022

Why Online Casinos are Much better than Actual Casinos

July 5, 2022
Facebook Twitter Instagram
Trending
  • SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK
  • 5 Reasons to Get Snow Plowing Solutions
  • Why Online Casinos are Much better than Actual Casinos
  • Making Use Of Key Phrases to Achieve Social Media Search Engine Optimization Success
  • Just How Snow Elimination Organization Task
  • The future of white label PPC services
  • Power Saw Security And Also Running Therapies
  • A Brief History of the Discount Department Store Industry
Facebook Twitter Instagram YouTube
Reality Paper Reality Paper
Demo
  • Home
    Featured
    Recent

    SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK

    July 5, 2022

    5 Reasons to Get Snow Plowing Solutions

    July 5, 2022

    Why Online Casinos are Much better than Actual Casinos

    July 5, 2022
  • Business
    1. Finance
    Featured
    Business By Sahir Malik

    SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK

    By Sahir MalikJuly 5, 2022 Business
    Recent

    SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK

    July 5, 2022

    5 Reasons to Get Snow Plowing Solutions

    July 5, 2022

    Just How Snow Elimination Organization Task

    July 5, 2022
  • News
    Featured
    News By Pooja Sharma

    Get Health and Personal Finance News in Newsmax Channel

    By Pooja SharmaMarch 4, 2022 News
    Recent

    Get Health and Personal Finance News in Newsmax Channel

    March 4, 2022
  • Technology
    1. App Development
    2. Web Development
    3. Mobile Phones
    4. Gaming
    5. Social Media
    6. Digital Marketing
    7. Automation
    Featured
    Technology By Sahir Malik

    Making Use Of Key Phrases to Achieve Social Media Search Engine Optimization Success

    By Sahir MalikJuly 5, 2022 Technology
    Recent

    Making Use Of Key Phrases to Achieve Social Media Search Engine Optimization Success

    July 5, 2022

    Best Mid-Range Budget Laptops For Students You Can Buy

    July 5, 2022

    How to sort out the Orbi white light error on router?

    July 2, 2022
  • Education
    Featured
    Education By Sahir Malik

    Australia’s Top Five Fastest Growing Industries In 2022

    By Sahir MalikJuly 5, 2022 Education
    Recent

    Australia’s Top Five Fastest Growing Industries In 2022

    July 5, 2022

    What is the actual meaning of case study?

    July 4, 2022

    Best Platform for Taking Online Classes

    June 30, 2022
  • Travel
    Featured
    Travel By Sahir Malik

    Do I Need A Sri Lanka Tourist Visa for US Citizens?

    By Sahir MalikJuly 1, 2022 Travel
    Recent

    Do I Need A Sri Lanka Tourist Visa for US Citizens?

    July 1, 2022

    How does the primary automated using Driving Lesson?

    July 1, 2022

    The best ways to see Chicago in a luxury limo

    June 30, 2022
  • Health
    Featured
    Health & Fitness By Sahir Malik

    Drinking juices every day can keep you healthy.

    By Sahir MalikJune 13, 2022 Health & Fitness
    Recent

    Buy Modalert 200mg Smart Pill to Treat Sleep Disorder

    July 5, 2022

    The Top 5 Health Benefits Of Eating Raw Marijuana Seeds!

    July 5, 2022

    The Key To Men Physical Health Is Their Mental Health

    July 5, 2022
  • Sports
    Featured
    Life Style By Reality Paper

    Custom Built Chopper Motorcycles

    By Reality PaperJune 3, 2022 Life Style
    Recent

    Custom Built Chopper Motorcycles

    June 3, 2022

    Best Pickleball Paddles for Power

    April 26, 2022
  • Food
    1. Recipe
    Featured
    Food By Sahir Malik

    Advertise and Market Your Pizza Business Online

    By Sahir MalikJuly 1, 2022 Food
    Recent

    Advertise and Market Your Pizza Business Online

    July 1, 2022

    Truffle boxes are an outdated marketing strategy?

    June 30, 2022

    Basmati Brown Rice Pulao

    June 18, 2022
  • General
    1. Auto-Mobile
    2. Real Estate
    3. Fashion
    4. Life Style
    5. Home Improvement
    6. Events
    7. Featured
    Featured
    General By Sahir Malik

    Allow new releases of every rap music, even if you’re not a

    By Sahir MalikJuly 1, 2022 General
    Recent

    Allow new releases of every rap music, even if you’re not a

    July 1, 2022

    5 reasons why packaging owners use rigid packaging

    June 29, 2022

    9 methods for lessening school pressure

    June 27, 2022
Reality PaperReality Paper
Home » Ternary and Logical Operators in C- CSE Notes for 2023
Education

Ternary and Logical Operators in C- CSE Notes for 2023

Pooja SharmaBy Pooja SharmaFebruary 28, 2022No Comments3 Mins Read
Facebook Twitter Pinterest LinkedIn
Logical Operators
Share
Facebook Twitter LinkedIn Pinterest Email

In this article, we will talk about ternary and logical operators used in the C language. If you are a GATE aspirant looking for CSE notes, then you are at the right place. Read ahead to learn more.

Ternary Operator in C

We use the ternary operator to execute a code that is based on a binary condition’s result. The ternary operator in C takes in a binary condition in the form of input. It makes it very similar to the ‘if-else’ control flow block. However, it also returns a value that behaves very similar to a function.

Benefits of ternary operator:

  1. The ternary operator is basically the class of conditional operator that will serve the very basic function, and in simple words, provide the programmers with ease of making different kinds of decisions.
  2. It will perform the same function as that of the if/else condition, but it will change the overall outlook and length of the available code.
  3. The ternary operator will make the code that will be very easy to understand.It will look much more professional as well as algorithmic in the whole process. In this way, there will be no chance of any kind of difficulty to the concerned users throughout the process.
  4. The decision-making will become very much easy in this particular case because ternary operator will provide people with easy-to-use systems to avoid any kind of chaos.

So, the ternary operator’s main advantage is that it will improve the application’s performance by reducing the number of code lines.

Also Read: Who can apply for the BPSC CDPO exam?

Here is a syntax of the ternary operator in C

result = binaryCondition ?valueReturnedIfTrue : valueReturnedIfFalse;

Note- We cannot use the ternary to execute code. So, in this case, it must either be returned in the given function or set equal to the variable with a similar data type as that of the returned values.

Here is an example of the ternary operator in C

//Looking at the maximum example

int findMaximum(int x, int y){

//if x > y, it returns x, if not it returns y

return (x > b) ? x : y;

}

Logical Operators in C

The logical operators constitute to be a part of binary operators. The logical operators are used specifically when we combine multiple requirements together. Then these can be utilised in numerous relational and conditional expressions. So, when we evaluate these conditions, these are the Boolean expressions that give an output of either 1/0 for True/False respectively. Let us learn below about different logical operators used in the C programming language.

Logical Operators in C – The three primary logical operators are ‘!’, ‘||’ and ‘&&’. We can understand the truth tables by:

p       q        p && q       p || q

1        0        0        1

1        1        1        1

0        1        0        1

0        0        0        0

And for NOT operator:

a        !a

1        0

0        1

The output 0’ and ‘1’ ‘denotes the False and True. Through these, those conditional operations that we perform can be very well understood.

Want to learn more or logical operators? Visit here at logical operators in C or check more CSE notes. Are you a GATE aspirant? So, learn more about every topic in detail and prepare for GATE 2023! All the best for your exams. Ciao!

Logical Operators in C Ternary and Logical Operators ternary operator in C
Share. Facebook Twitter Pinterest LinkedIn
Pooja Sharma
  • Website

Author Bio: Hi, I’m Pooja and I’m a passionate Blogger, Freelancer, Writer, and Digital Marketer. and I love tech stuff and games. Gembells, Hotmaillog.

Related Posts

Australia’s Top Five Fastest Growing Industries In 2022

July 5, 2022

What is the actual meaning of case study?

July 4, 2022

Best Platform for Taking Online Classes

June 30, 2022

Leave A Reply Cancel Reply

Demo
Our Picks
Stay In Touch
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
  • Vimeo
Don't Miss
Business
Business By Sahir Malik

SELL Buy INSTAGRAM Followers TIPS THAT ACTUALLY WORK

By Sahir MalikJuly 5, 2022 Business

Your Instagram business profile Follwers is much of the time the primary resource a client…

5 Reasons to Get Snow Plowing Solutions

July 5, 2022

Why Online Casinos are Much better than Actual Casinos

July 5, 2022

Making Use Of Key Phrases to Achieve Social Media Search Engine Optimization Success

July 5, 2022

Subscribe to Updates

Get the latest creative news from SmartMag about art & design.

© 2022 All Rights Reserved by Reality Paper Net
  • Realitypaper Net
  • Terms and Conditions
  • Privacy Policy
  • Write for Us
  • Guest Posting Guidelines
  • Contact Us
  • About us

Type above and press Enter to search. Press Esc to cancel.