Showing posts with label number-character pattern C program. Show all posts
Showing posts with label number-character pattern C program. Show all posts

7.03.2013

Number-Character Pattern

Q. Write a C program to print the following number-character pattern as:

1111111
1A1AAAA
1AA1AAA
1AAA1AA
1AAAA1A
1AAAAA1
1111111

Ans.

/*c program for number-character pattern*/
#include<stdio.h>
int main()
{
 int num=7,r,c,z;
 printf("1111111\n");
 for(r=1; r<=5; r++)
 {
  for(c=1; c<=num; c++)
  {