Program 309: Spiral Pattern in C
//Coming Soon...
Output:
#include<stdio.h> main() { int i,rows,k=1; printf("Enter number of Rows for Spiral Pattern\n"); scanf("%d",&rows); for(i=1;i<=rows*2;i+=2) { if(k%2==1) { printf("%3d %3d",i,i+1); k++; } else { printf("%3d %3d",i+1,i); k++; } printf("\n"); } }
Spiral Alphabet PatternExplanation:
Output: