Conditional Operator in C++ | C++ Conditional Operator - C++ Tutorial 26
ฝัง
- เผยแพร่เมื่อ 12 ส.ค. 2020
- Notes for You:: Conditional Operator in C++.
- is the ternary operator in C++.
- It accepts 3 operands.
(operand1) ? operand2 : operand3;
Where:
operand1: must be a condition
operand2: value1 // true part
operand3: value2 // false part
Example:
- Program to find the given number is even or odd.
#include <iostream>
using namespace std;
int main()
{
int num = 15;
cout << num << " is " << ((num%2==0) ? "even" : "odd") << endl;
return 0;
}
Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.
=========================================
Follow the link for next video:
In this C++ Tutorial you understand the Difference Between the Decimal and Binary Number Systems.
• Binary vs Decimal Numb...
Follow the link for previous video:
C++ Tutorial 25 - Increment and Decrement Operators in C++ - Part 2
• Increment & Decrement ...
=========================================
C++ Tutorials Playlist:
• C++ Tutorials
=========================================
Watch My Other Useful Tutorials:-
C# Tutorials Playlist:-
• C# Tutorials
Java Tutorials Playlist:-
• Java Tutorials
C Programming Tutorials Playlist:
- • C Programming Tutorials
C Practical LAB Exercises Playlist:-
• C Practical Programs
=========================================
► Subscribe to our TH-cam channel:
/ chidrestechtutorials
► Visit our Website:
www.chidrestechtutorials.com
=========================================
Hash Tags:-
#ChidresTechTutorials #CPlusPlus #CPlusPlusTutorial #CPP #CPPTutorial
Once you watch the video; answer the following questions:
1. Explain conditional operator in c++
Sir please please complete all the topics in c++
Very good sir
Thank you. Please do subscribe share and support.
Thanku sir
Most welcome
Sir,when the remaining part comes especially about loops
Soon Albit Biju
It's been 1 year since that message. I think he isn't active on TH-cam anymore!
Hi, can this question be solved
write oop find result x!+power(x,y) if x in class a and y in class b ?
Hope you found solution
Sir please aap mujy ye sb hindhi mai smjha doge .....apke notes bhutt best hai pr mujy hindhi mai smjha do ye please
Thank you.
sir it gives me error after running it in visual code studio
plz sir help me plz as soon as posible that i continue another remaining course from your playlist
thank you
#include
using namespace std;
int main() {
int Mynum = 7
cout
int Mynum = 7 should be int Mynum = 7;
@@ChidresTechTutorials thanks alot sir