0

how to add an int as well as a string in an if statement's condition???

4th Nov 2016, 4:48 AM
Abdus Samad
Abdus Samad - avatar
2 Answers
0
#include<iostream> using namespace std; int main(){ int x = 9; string f = "Hello"; if(x <= 10 && f == "Hello"){ cout << "hello"; //some code if the statement declared if true } return 0; } // You can use && for an and operation when both statement have to be true or || (or) statement which either 1 of them is true the code will be executed
4th Nov 2016, 5:04 AM
Abdelaziz Abubaker
Abdelaziz Abubaker - avatar
0
got it bro
4th Nov 2016, 6:00 AM
Abdus Samad
Abdus Samad - avatar