What do you want to save?
Add Code snippet
New code examples in category C++
-
Awgiedawgie 2022-05-13 22:26:42
find pair in unsorted array which gives sum x
// C++ program to check if given array // has 2 elements whose sum is equal // to the given value #include <bits/stdc++.h> using namespace std; // Function to check if array has 2 elements // whose sum is equal to the given value bool h... Add solution -
Awgiedawgie 2022-05-13 22:15:36
check if element in std vector
#include <iostream> #include <vector> #include <algorithm> int main() { std::vector<int> v = { 4, 7, 5, 2, 6, 9 }; int key = 6; if (std::count(v.... Add solution -
Awgiedawgie 2022-05-13 22:10:38
c++ add object to array
int main() { Student st[5]; for( int i=0; i<5; i++ ) { cout << "Student " << i + 1 << endl; cout << "Enter name" << endl; st[i].getName(); cout << "Enter marks" << endl;... Add solution -
Phoenix Logan 2022-05-13 18:55:04
to_string c++
// to_string example #include <iostream> // std::cout #include <string> // std::string, std::to_string int main () { std::string pi = "pi is " + std::to_string(3.1415926); std::string perfect = std::to_string(1+2+4+7+14) +... Add solution
Best helpers
Ranking is empty