## Caesar Cipher problem in python

A Caesar cipher is a simple substitution cipher in which each letter of the plain text is substituted with a letter found by moving n places down the alphabet. For example, assume the input plain text is the following: If the shift value, n, is 4, then the encrypted text would be the following: You are to write … Read more

## How to swap two numbers without using a third variable?

int a = 10;int b = 20; b = b + a; // now b is sum of both the numbersa = b – a; // b – a = (b + a) – a = b (a is swapped)b = b – a; // (b + a) – b = a (b is swapped) … Read more

## How to reverse a String in Java?

It might be surprising, but there is no reverse() utility method in the String class. But, it’s a very simple task. We can create a character array from the string and then iterate it from the end to start. We can append the characters to a string builder and finally return the reversed string. public … Read more

## Print a number 100 times without using loop, recursion and macro expansion in C++?

It is possible to solve this problem using loop or a recursion method. And we have already seen the solution using #define directive (Macro expansion) but what if all three are not allowed?A simple solution is to write the number 100 times in cout statement. A better solution is to use concept of Concept of setjump and longjump … Read more

Categories C++