Answers for "if statement or c++"

C++
5

c++ if in equivalent

#include <algorithm>
#include <vector>

if ( std::find(vec.begin(), vec.end(), item) != vec.end() )
   do_this();
else
   do_that();
Posted by: Guest on July-09-2020
0

if else in C++

//1
if(condition) {
   statement(s);
}
else {
   statement(s);
}
//2
(condition) ? (true_statement) : (false_statement)
Posted by: Guest on April-30-2021
-1

c++ if

int x; 
cout << "Type a number: "; 			// Type a number and press enter
cin >> x; 							// Get user input from the keyboard
cout << "Your number is: " << x; 	// Display the input value
Posted by: Guest on October-13-2021

Browse Popular Code Answers by Language