cbr
public c v1 · immutable#include <stdio.h>void hanoi(int disks, char tower_from, char tower_to, char tower_help) { if(disks==1) { printf("Take disk from tower %d to tower %d.\n",tower_from,tower_to); return; } else { hanoi(disks-1, tower_from, tower_help, tower_to); printf("Take disk from tower %d to tower %d.\n",tower_from,tower_to); hanoi(disks-1, tower_help, tower_to, tower_from); }}int main(int disks) { printf("Enter no of disks: "); scanf("%d",&disks); hanoi(disks, 1, 3, 2);}