Print All Prime Quadruplets of a Number Less Than It in C++

sudhir sharma
Updated on 17-Jan-2020 11:12:58

209 Views

In this problem, we are given a positive integer N, and we have to print all prime quadruplet less than or equal to n.Prime quadruplets are the set of four prime numbers calculated as {p, p+2, p+6, p+8}. Example − 5 7 11 13.Let’s take an example to understand the problem −Input: N = 15 Output: 5 7 11 13.To solve this problem, a simple approach is to generate all quadruplets of prime number p and check if all p, p+2, p+6, p+8 are prime numbers. This solution is easy but is more complex for the compiler.Another efficient approach is ... Read More

Simple Ways to Earn Money Online

Samual Sam
Updated on 17-Jan-2020 11:11:38

301 Views

Earning money online seems to be an attractive prospect for someone who can spare those extra hours to earn extra bucks. But most of the times, users feel disappointed as there is no definite way that can guide them to some reliable ways and means to start. All the ads out there are not always genuine. And yes, if you are too desperate to make some quick money, you are bound to be disappointed.Here are some points that can be taken into consideration before venturing into the online money making business. Though this seems to be a lucrative opportunity to ... Read More

Print All Proth Primes Up to n in C++

sudhir sharma
Updated on 17-Jan-2020 11:09:28

209 Views

In this problem, we are given an integer N and we have to print all proth prime numbers less than or equal to N.Proth Prime NumberA proth prime number is a positive integer whose value can be represented as n = k* 2n + 1. where k is an odd positive integer and n is a positive integer and both satisfy the 2n > k.Examples − 3, 5, 13…..Let’s take an example to understand the topic better −Input: N = 23 Output: 3, 5, 13, 17.For this, we will find all the prime numbers less than N(for this we will ... Read More

Print All Root to Leaf Paths with Their Relative Positions in C++

sudhir sharma
Updated on 17-Jan-2020 11:07:39

172 Views

In this problem, we are given a binary tree. And we have to print all the paths from the root to the leaf of the tree. Also, add underscore “_” to show the relative positions of the nodes.Let’s take an example to understand the topic better −Input −Output −_ _ 3 _ 9 1 _3 9 _7 3 _ 4 _ _ 2 3 9 4 1 7 6 2 3 _ 4 6To solve this problem, we will use the concept of the vertical order of the elements of the tree.Based on this, we will print the path from ... Read More

Top 10 Chrome Extensions for Work

karthikeya Boyini
Updated on 17-Jan-2020 11:07:20

474 Views

Google Chrome is one of the most loved browser in today’s IT world. It is fast, reliable, secure and simple. Along comes the huge list of extensions. The extensions are tiny programs, running in the background, which helps in modifying and enhancing the features and functionalities of Chrome browser. Here are the top 10 extensions of Chrome that can really help in improving your productivity at work.Copy All URLsThis is a very useful extension for those who often works on multiple tabs. While working on multiple site if you want to copy multiple URLs, then this extension comes in handy. ... Read More

Add Debugging Code to JavaScript

Krantik Chavan
Updated on 17-Jan-2020 11:06:09

234 Views

To add debugging code to JavaScript, use the alert() or document.write() methods in your program. For example,var debugging = true; var whichImage = "widget"; if( debugging ) alert( "Calls swapImage() with argument: " + whichImage ); var swapStatus = swapImage( whichImage ); if( debugging ) alert( "Exits swapImage() with swapStatus=" + swapStatus );Examine the content and order of the alert() as they appear, you can examine the health of your program very easily.

Rolltop: A Laptop You Can Roll

Samual Sam
Updated on 17-Jan-2020 11:05:03

6K+ Views

When the German company, Orkin Design had conceptualized the Rolltop in 2009, a laptop that will come with a screen so flexible that it can actually be rolled into a sort of scroll, it had caught the attention (and imagination) of the entire world. The tech company said that it will use flexible OLED and touchscreen technologies to create a cylinder-shaped laptop. The lower part of the screen is used as a keyboard while the upper part becomes a 13-inch display. It can also be rolled into a tablet, or expanded to a full 17-inch monitor with a pull-out support ... Read More

Print All Safe Primes Below N in C++

sudhir sharma
Updated on 17-Jan-2020 11:04:32

160 Views

In this problem, we are given an integer N and we have to print all safe prime number whose values are less than N.A safe prime number is a prime number which can be represented as [(2*p)- 1] where p is also a prime number.Examples − 5[(2*2) +1] , 7[(2*3)+1].Let’s take a few examples to understand the problem better −Input: N = 12 Output: 5 7 11.To solve this problem, we will find all the prime numbers less than N(for this we will use Sieve of Eratosthenes). And check if the prime number is a safe prime number or not ... Read More

Top 5 Best Linux Text Editors

karthikeya Boyini
Updated on 17-Jan-2020 11:03:04

1K+ Views

A text editor is a kind of program used for modifying simple text records. Such packages are repeatedly often called “notepad” application, following the Microsoft Notepad. This article explains about -“Top 5 Best Linux Text Editors”Vi EditorVim is a pre-set up text editor that’s upwards suitable to Vi. It may be used to edit all sorts of plain textual content. It is exceptionally priceless for enhancing packages.To open Vi editor, use the following command –$viThe sample output should be like thisTo get the more infomation about Vi editor, use the following command –$ vi --helpThe sample output should be like ... Read More

Print All Sequences of Given Length in C++

sudhir sharma
Updated on 17-Jan-2020 11:02:28

794 Views

In this problem, we are given two integer values, k, and n. And we have to print all the sequences of length k from numbers from 1 to n in sorted order.Let’s take an example to understand the topic −Input:k = 2 ; n = 3 Output: 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3So in this problem, we have to print the sequence as stated above.A simple way to solve this problem is by incrementing integers of the sequence till they get to the max value i.e. n. The ... Read More

Advertisements