UrbanPro

Learn C++ Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

How do I use the logical NOT operator (!) in C++?

Asked by Last Modified  

Follow 1
Answer

Please enter your answer

Experienced Computer trainer having worked in IT sector for 20 years.

The “not” logical operator is used to convert a value from true to false, or from false to true. Similarly, if an operand evaluates to true, a logical “not” would cause it to evaluate to false. #include <iostream> using namespace std; int main() { cout <<...
read more

The “not” logical operator is used to convert a value from true to false, or from false to true. Similarly, if an operand evaluates to true, a logical “not” would cause it to evaluate to false.

#include <iostream>

using namespace std;

 

int main()

{

    cout << "Enter a number: ";

    int x {};

    cin >> x;

    

    if (!x == 0)

        cout << "You typed a number other than 0";

    else

        cout << "You typed zero";

    return 0;

}

read less
Comments

C language Faculty (online Classes )

Operator. The “not” logical operator is used to convert a value from true to false, or from false to true. Similarly, if an operand evaluates to true, a logical “not” would cause it to evaluate to false. If an operand evaluates to false, its logical “not” equivalent...
read more

Operator. The “not” logical operator is used to convert a value from true to false, or from false to true. Similarly, if an operand evaluates to true, a logical “not” would cause it to evaluate to false. If an operand evaluates to false, its logical “not” equivalent would be true.

read less
Comments

Related Questions

What are the toughest topics in C language?
1. pointer 2. dynamic memory allocation 3. File handling
Lokayya
0 0
5
how to use dos.h
First include dos.h header file then use their function. Before use function, you must have knowledge of dos functions and their charactistics
Aman
How do I perform multiplication in C++?
Multiplication in C++ is as simple as using the * operator. It's a fundamental arithmetic operation, familiar to most developers even with minimal experience in the language. The basic concept involves...
Venkataramanaiah
0 0
5
What is the use of virtual keyword in inheritance?
use of virtual keyword in inheritance-------> Multiple inheritance in C++ is a powerful, but tricky tool, that often leads to problems if not used carefully. This article will teach you how to use virtual...
Shabbir
What is the difference between class and structure?
Basic difference between class and structure is that Structures are used to store data and a class defined both data and the functions that access that data.
Aparna
0 0
8

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Recommended Articles

Introduction C++ is an excellent programming language and many of the applications are written in C++ language. It has generic, object-oriented & imperative programming features, and also provides facilities for low-level memory manipulation. Successor of C language, it is an OOP (object oriented programming) language...

Read full article >

Almost all of us, inside the pocket, bag or on the table have a mobile phone, out of which 90% of us have a smartphone. The technology is advancing rapidly. When it comes to mobile phones, people today want much more than just making phone calls and playing games on the go. People now want instant access to all their business...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Business Process outsourcing (BPO) services can be considered as a kind of outsourcing which involves subletting of specific functions associated with any business to a third party service provider. BPO is usually administered as a cost-saving procedure for functions which an organization needs but does not rely upon to...

Read full article >

Looking for C++ Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C++ Language Classes?

The best tutors for C++ Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C++ Language with the Best Tutors

The best Tutors for C++ Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more