You need to take an integer input and then draw the pattern according to it.
Say for example if you enter 6 then, the pattern should be like this-
1 2 3 4 5 |
A B C D E A B C D E A B C D E A B C D E A B C D E |
Input Format
You will take an integer input n from stdin.
Constraints
1 <= n <= 1000
Output Format
Your output should be the pattern according to the input which you had entered.
Sample TestCase 1
Input
5
Output:
1 2 3 4 5 |
A B C D E A B C D E A B C D E A B C D E A B C D E |
Write a C program to print following pattern
12345
A B C D EA B C D EA B C D EA B C D EA B C D E
1 2 3 4 5 |
A B C D E A B C D E A B C D E A B C D E A B C D E |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#include<stdio.h> int main() { int n=0; int i=1,j=0; scanf("%d",&n); int num=n; while(n>0) { for(i=1,j=65;i<=num;i++) { printf("%c ",j); j++; } printf("\n"); n--; } } |
Output
1 2 3 4 5 |
A B C D E A B C D E A B C D E A B C D E A B C D E |