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 opini...

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

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 opini...

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. ...

How to convert google play balance to paypal or UPI [2024]

If your google account contains play balance which you might have earned from google competitions, opinion rewards or gift vouchers, you can transfer the amount to paypal account or any UPI linked bank account.  For transferring the play balance you need to follow 3 simple steps :  1) Download QxCredit app from google play store:                                 2) Purchase a token of your choice by entering the payout details :            3) View your purchase in my tokens section and wait for 72 hours for the transaction to be verified and processed. The below video demonstrates the process of purchasing a token of your choice to convert play balance: After purchasing token you will also receive a confirmation mail from QxCredit regarding the purchased token information. You can also view your purchased token on QxCredit website:...