
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

135 Views
In this tutorial, we will be discussing a program to find the maximum of smallest possible area that can get with exactly k cut of given rectangular.For this we will be provided with the sides of the rectangle and the number of cuts that can be made. Our task is to calculate the smallest area that can be achieved by making the given number of cuts.Example Live Demo#include using namespace std; void max_area(int n, int m, int k) { if (k > (n + m - 2)) cout

1K+ Views
CountDownLatch and CyclicBarrier both used in multithreading environment and they both are part of.As per Java Doc −CountDownLatch − A synchronization aid that allows one or more threads to wait until a set of operations being performed in other threads completes.CyclicBarrier − A synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.Sr. No.KeyCyclicBarrierCountDownLatch1BasicA synchronization aid that allows a set of threads to all wait for each other to reach a common barrier point.A synchronization aid that allows one or more threads to wait until a set of operations being ... Read More

524 Views
In this tutorial, we will be discussing a program to find HCF (highest common factor) of two numbers.For this we will be provided with two numbers. Our task is to find the highest common factor (HCF) of those numbers and return it.Example Live Demo#include //recursive call to find HCF int gcd(int a, int b){ if (a == 0 || b == 0) return 0; if (a == b) return a; if (a > b) return gcd(a-b, b); return gcd(a, b-a); } int main(){ int a = ... Read More

155 Views
In this tutorial, we will be discussing a program to find greater value between a^n and b^n.For this we will be provided with three numbers. Our task is to calculate a^n and b^n and return back the greater of those values.Example Live Demo#include using namespace std; //finding the greater value void findGreater(int a, int b, int n){ if (!(n & 1)) { a = abs(a); b = abs(b); } if (a == b) cout b) cout

620 Views
In this tutorial, we will be discussing a program to find GCD and HCF of two numbers.For this we will be provided with two numbers. Our task is to find the GCD or HCF (highest common factor) for those given two numbers.Example Live Demo#include using namespace std; int gcd(int a, int b){ if (a == 0) return b; if (b == 0) return a; if (a == b) return a; if (a > b) return gcd(a-b, b); return gcd(a, b-a); } int main(){ int a = 98, b = 56; cout

824 Views
Kafka and JMS both are messaging system. Java message service is an api which are provided by Java. It is used for implementing messaging system in your application. JMS supports queue and publisher /subscriber(topic) messaging system . With queues, when first consumer consumes a message, message gets deleted from the queue and others cannot take it anymore. With topics, multiple consumers receive each message but it is much harder to scale.Kafka is a generalization of these two concepts - it allows scaling between members of the same consumer group, but it also allows broadcasting the same message between many different ... Read More

828 Views
JMS is an acronym Java message service. Java message service is an api which are provided by Java. It is used for implementing messaging system in your application.JMS is an API or specification which does not contain implementation therefore to use JMS have to some third party service provider like ActiveMq , Weblogic messaging and etc.JMS support two types of messaging domain −Point to Point MessagingPublish /Subscribe messaging Sr. No.KeyPoint to Point MessagingPublish /Subscribe1BasicIt is one to one destination of message. Message sent into the queue and that message can be read by only one receiver.It is one to many ... Read More

1K+ Views
In this tutorial, we will be discussing a program to find GCD or HCF of two numbers using Middle School Procedure.For this we will be provided with two numbers. Our task is to find the GCD (greatest common divisor) or HCF (highest common factor) for the given values.Example Live Demo#include #define MAXFACTORS 1024 using namespace std; //structure to store factorization typedef struct{ int size; int factor[MAXFACTORS + 1]; int exponent[MAXFACTORS + 1]; } FACTORIZATION; void FindFactorization(int x, FACTORIZATION* factorization){ int i, j = 1; int n = x, c = 0; int k = ... Read More

495 Views
In this tutorial, we will be discussing a program to find GCD of floating point numbers.For this we will be provided with two integers. Our task is to find the GCD (Greatest common divisor) of those two provided integers.Example Live Demo#include using namespace std; //returning GCD of given numbers double gcd(double a, double b){ if (a < b) return gcd(b, a); if (fabs(b) < 0.001) return a; else return (gcd(b, a - floor(a / b) * b)); } int main(){ double a = 1.20, b = 22.5; cout

127 Views
In this tutorial, we will be discussing a program to find N lccanobif numbers.For this we will be provided with an integer. Our task is to find the lccanobif number at that position. They are similar to the fibonacci number except the fact that we add the previous two numbers after reversing their digits.Example Live Demo#include using namespace std; //reversing the digits of a number int reverse_digits(int num){ int rev_num = 0; while (num > 0) { rev_num = rev_num * 10 + num % 10; num = num / 10; ... Read More