What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-03-17 03:00:05
nested for loops pyramid c++
//WAP to print triangle pattern... LOGIC int num{}, i{1}; cin >> num; while (i <= num) { for (int space = 1; space <= (num - i); space++) { // space cout << " "; } for (int value = 1; value <= (2 * i -... Add solution -
Html 2022-03-17 02:20:07
spacing bootstrap
Use the margin and padding spacing utilities to control how elements and components are spaced and sized. Bootstrap 4 includes a five-level scale for spacing utilities, based on a 1rem value default $spacer variable. Choose values for all viewports (e.g.... Add solution -
C++ 2022-03-16 23:40:31
c++ check if odd or even
#include <iostream> using namespace std; int main() { int n; cout << "Enter an integer: "; cin >> n; (n % 2 == 0) ? cout << n << " is even." : cout << n << " is odd.";... Add solution -
C++ 2022-03-15 04:15:12
c++ void to avoid functions
/*The following example collects user data and formats it using seperate void statements */ #include <iostream> #include <string> #include <stdio.h> #include <stdlib.h> using namespace std; // function declarations void inputData... Add solution -
C++ 2022-03-13 06:15:02
static inside local scope in c++
#include<iostream> //Singleton class is a class having only one instance class SingleTon { public: static SingleTon& Get() { static SingleTon s_Instance; return s_Instance; }//there is only one instance of static functions and variables a... Add solution -
C++ 2022-03-12 02:30:03
prims c++
#include <iostream> #include <vector> #include <queue> #include <functional> #include <utility> using namespace std; const int MAX = 1e4 + 5; typedef pair<long long, int> PII; bool marked[MAX]; vector <PII> adj[M... Add solution -
Javascript 2022-03-11 08:10:23
javascript splice
let arr = ['foo', 'bar', 10, 'qux']; // arr.splice(<index>, <steps>, [elements ...]); arr.splice(1, 1); // Removes 1 item at index 1 // => ['foo', 10, 'qux'] arr.splice(2, 1, 'tmp'); // Replaces 1 item at index 2 with 'tmp' // => ['... Add solution -
C++ 2022-03-10 00:05:02
c++ two array find same values
#include <iostream> #include <cstdlib> #include <conio.h> using namespace std; int main() { int p[4] ,p1[4], num = 0 , p2[] = {}; cout<<"Enter 4 numbers of the first array "; for(int a=0;a<4;a++){ cin>>p[a]; ... Add solution