#include<stdio.h>int n;void hailstones(n){int j=0,a; do {printf("%4d",n);j++;if(j%6==0) printf("\n");a=n%2;switch(a){ case 0:n=n/2;break; case 1:n=3*n+1;break;} }while(n!=1);}main(){ printf("Hailstones generated by n :");scanf("%d",&n);hailstones(n);}