ACID Transactions in Databases: A Q&A Guide❓ What exactly is a transaction in a database? A transaction is a sequence of one or more operations (such as inserts, updates, or deletes) that are executed as a single logical unit. The central idea is that all these operations must either complete...Apr 15, 2025·4 min read
C Questions.1) What will be the output of the following code snippet? #include <stdio.h> void solve() { int x = 2; printf("%d", (x << 1) + (x >> 1)); } int main() { solve(); return 0; } Explanation: The above example uses the knowledge of bitwis...Jul 21, 2024·13 min read
C++ Output Questions/MCQs1) What happens if the following C++ statement is compiled and executed? int *ptr = NULL; delete ptr; Explanation: The above statement is syntactically and semantically correct as C++ allows the programmer to delete a NULL pointer, therefore, the pr...Jul 17, 2024·12 min read
C++ Revision Day-61) How to input string in C++? There are three ways to input a string, using cin, get, and getline. All three methods are mentioned in the sample program below. #include <iostream> using namespace std; int main() { char s[10]; cout << "Ente...Jul 16, 2024·2 min read
C++ Revision Day-51) What is an abstract class in C++? An abstract class in C++ is such that cannot be used directly and is used to form a base class for others to inherit from. If you create an object for an abstract class the compiler will throw an error at you. In ...Jul 13, 2024·7 min read
C++ Revision Day-41) How to sort vector in C++ ? #include<bits/stdc++.h> using namespace std; //custom fuction to sort increasing order bool sortInc(int a,int b) { return a<b; } //custom function to sort in decreasing bool sortDec(int a,int b) { return a>b; ...Jul 12, 2024·6 min read
C++ Revision Day-31) What is the difference between reference and pointer? ReferencePointer Reference is used to refer to an existing variable in another name.Pointers are used to store the address of a variable. References cannot have a null value assignedThe...Jul 11, 2024·2 min read