Pyramid Problem No. 89
Q.89 Any number geometric sequence number pyramid as:
7 14 15 28 29 30 31 56 57 58 59 60 61 62 63
Solving in C :#include <stdio.h> #include<math.h> int main(){ int n=4,row,col,count; for(row=0; row<n; row++){ for(col=1,count=7*pow(2,row); col<=pow(2,row); col++) printf("%-3d",count++); printf("\n"); } return 0; }
Comments
Post a Comment