Skip to main content

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opinion r

Tower of Hanoi C / C++ / Python Program

Tower of hanoi is a mathematical game or puzzle. It consists of three rods and a number of disks of different sizes, which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.


The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:
  1. Only one disk can be moved at a time.
  2. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack or on an empty rod.
  3. No larger disk may be placed on top of a smaller disk.

With 3 disks, the puzzle can be solved in 7 moves. The minimal number of moves required to solve a Tower of Hanoi puzzle is 2n − 1, where n is the number of disks.
For example consider 3 disks ,it can be solved in 2-1 steps :
Steps required to be performed for solving tower of hanoi problem  :


The universal way (steps ) to solve this type of problem are:
N=number of disks :
A,B,C are rods :
1) move N-1 disks from A to B using C
2) move the remaining single disk in A to C
3) move N-1 disks from B to C using A 

The Recursive Function based on the above steps is defined below
void TOH(int n,char a,char b,char c){
     if(n>0){
         TOH(n-1,a,c,b);
         printf("%d from %c to %c\n",n,a,c);
         TOH(n-1,b,a,c);
         s++;
     }
 }

Output :
For N=3:


For N=7

C / C++ Source Code :
#include <stdio.h>
#include<conio.h>
#include<time.h>
#include<direct.h>
#include<dos.h>
#include<unistd.h>
#include<windows.h>
static int s=0;
void TOH(int n,char a,char b,char c);
int main(int argc, char *argv[]) {
 int n;
 time_t t1=time(NULL);
 printf("Enter number of discs ");
 scanf("%d",&n);
 TOH(n,'A','B','C');
 time_t t2=time(NULL);
 time_t t=t2-t1;
 printf("\n\nsteps=%d time elapsed=%d seconds ",s,t);
 getch();
 return 0;
}
void TOH(int n,char a,char b,char c){
 if(n>0){
  TOH(n-1,a,c,b);
  printf("%d from %c to %c\n",n,a,c);
  TOH(n-1,b,a,c);
  s++;
 }
}


Python Source code :
s = 0


def TOH(n, a, b, c):
    global s
    if n > 0:
        TOH(n - 1, a, c, b)
        print("Move %d from %s to %s\n" % (n, a, c))
        TOH(n - 1, b, a, c)
        s += 1


if __name__ == '__main__':
    n = int(input("Enter number of discs : "))
    TOH(n, "A", "B", "C")
    print("\n\nsteps=%d \n" % s)


if any doubts or queries please comment 🙂

Comments

Post a Comment

Popular posts from this blog

Python and C++ program to implement multiplication of 2d array (Matrix multiplication)

Here, in this program we are going to implement matrix multiplication , suppose matrix 1 has dimensions:m*n and matrix 2 has dimensions :p*q for these two matrix to be multiplied we need to have the number of columns in matrix 1(n) equal to the number of rows in matrix 2(p), if the condition is satisfied then the result of multiplication will be a matrix of order m*q in multiplication the elements of the resultant matrix will be the sum of product of corresponding elements of row(of M1) and column(of M2) //first element in 1st row in given example: res[0][0]+=mat1[0][i] * mat2[i][0] where 0<i<n or p //second element in 1st row: res[0][1]+=mat1[0][i] * mat2[i][1] where 0<i<n or p and so on………… Example : Input : 1 2 3 1 4 5 6 2 7 8 9 3 Output : 14 32 50 Input : 4 3 4 2 4 1 1 1 Output : multiplication not possible n!=p Here goes the main execution part where the calculation is been done: for ( int i = 0 ; i < r1 ; i ++) for ( int

Transfer google play balance to Paytm, PhonePe, Google Pay or any UPI linked bank account.

To transfer google play balance, opinion rewards or gift cards to PayPal, Paytm, PhonePe, Google Pay or any UPI ID linked bank account , you can use QxCredit :Rewards Convertor app which is available on google play store: You will get back 80% of the google play balance. App link:  https://play.google.com/store/apps/details?id=qxcoding.qx_credit_reboot Follow these steps to transfer your play balance to paypal or UPI: 1) download app from play store. 2) login with your google account and phone number. 3) choose a token amount which you want to convert/transfer. 4) Enter your payout details.(UPI ID or PayPal Email) 5) wait for an acknowledgement mail form qxcredit containing information about your purchased token. 6) you will receive the amount within 3 days. 7) if you face any issues you can raise a query on website: https://qx-credit.web.app/#/contact_support About app: Introducing QxCredit : Rewards Converter Convert /Transfer or Exchange your Google Play Balance and opinion r

What is AI (Artificial Intelligence )? and its characteristics

Definition : Artificial intelligence  (AI) is the ability of a  computer program  or a  machine  to think and learn. It is also a field of study which tries to make computers "smart". They work on their own without being encoded with commands. Types of AI : REACTIVE MACHINES:  The most basic type of AI is purely reactive ,it does not store any memory of past or predict ( calculate ) future happenings. This type of AI is only applicable to specific applications and the principle is choosing the best decision among several options. examples: Deep Blue, IBM’s chess-playing supercomputer LIMITED MEMORY :  this type 2 kind of AI machines are distinct from reactive machine in such a way that it can make optimum decisions based on the past information ( data ). examples: self driving cars. THEORY OF MIND:  The understanding that people,creatures and objects can have thoughts or emotions which effect their own behavior. This point is the important divide