Gblog Write It Up: Share Your Interview Experiences
Since we are receiving so many interview experiences, we have great news to share with you. Therefore, we are moving this event’s date up to… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :   Input : n = 4 Output… Read More
Given a positive integer, write a function to find if it is a power of two or not.Examples :  Input : n = 4 Output… Read More
Given a number n, find the result alfter multiplying it with 7. Example: Input: n=8 Output: 56 Naive Approach: The basic way to solve this… Read More
Write a program to reverse the digits of an integer. Examples :   Input : num = 12345 Output: 54321 Input : num = 876 Output:… Read More
Parity: Parity of a number refers to whether it contains an odd or even number of 1-bits. The number has “odd parity” if it contains… Read More
The very first solution that comes to our mind is the one that we learned in school. If the sum of digits in a number… Read More
Write a function which takes an array and prints the majority element (if it exists), otherwise prints “No Majority Element”. A majority element in an… Read More
Write a program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements in A[]… Read More
Write a function that, for a given no n, finds a number p which is greater than or equal to n and is the smallest… Read More
Algorithm: roundNo(num) 1. If num is positive then add 0.5. 2. Else subtract 0.5. 3. Type cast the result to int and return. Example: num… Read More
First of all we have to understand how printf() function works. Prototype of printf() function is: int printf( const char *format , ...) Parameter format:… Read More
Predict the output of the below program.  C++ #include <iostream> using namespace std;   int main() {     int x = 5;     int * const ptr… Read More
Predict the output of the below program   C++ #include <iostream> using namespace std;   #define square(x) x*x   int main() {   int x;   x… Read More
Featured Articles
View All