Pages

  • Home
  • About & Contact
  • Archive
  • C Programming Examples

08 January 2012

pattern programs in c. [alphabet pattern]

Here there are few Examples of alphabet pattern programs in c
Want to learn to solve patterns on your own than try this  How to solve [Code] Pattern Programs in C



ALPHABET PATTERN :1
    A
    BC
    DEF
#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n;
    char c;
    clrscr();

    printf("\nEneter the no of lines to be printed: ");
    scanf("%d",&n);
    c='A';
    for(i=0;i<n;i++)
    {
       for(j=0;j<=i;j++)
       {   if(c=='Z')
       break;
   printf("%c",c);
   c++;
       }
       printf("\n");
    }
    getch();
}


  Alphabet pattern :2
  A
  BB
  CCC



#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n;
    char c='A';
    clrscr();

    printf("\nEneter the no of lines to be printed: ");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
       for(j=0;j<=i;j++)
       {
   printf("%c",c);
       }
       c++;
       printf("\n");
    }
    getch();
}




 Alphabet pattern :3
A
      BC
    DEF




#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n,k;
    char c='A';

    clrscr();
    printf("\nEnter the no of lines to be printed: ");
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
       for(j=n-i;j>0;j--)
       {
   printf(" ");
       }
       for(k=0;k<=i;k++)
       {
   printf("%c",c);
   c++;
       }
       printf("\n");
    }
    getch();
}



 Alphabet pattern: 4
  ABCD
    EFG
      HI
       J




#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n,k;
    char c='A';
    clrscr();

    printf("\nEnter the no of lines to be printed: ");
    scanf("%d",&n);
    for(i=0;i<=n;i++)
    {
       for(j=0;j<=i;j++)
       {
   printf(" ");
       }
       for(k=n-i-1;k>=0;k--)
       {
   printf("%c",c);
   c++;
       }
       printf("\n");
    }
    getch();
}



Alphabet pattern:5         
         AAAA    
         BBB
           CC
             D



#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n,k;
    char c='A';

    clrscr();
    printf("\nEnter the no of lines to be printed: ");
    scanf("%d",&n);
    for(i=0;i<=n;i++)
    {
       for(j=0;j<=i;j++)
       {
   printf(" ");
       }
       for(k=n-i-1;k>=0;k--)
       {
   printf("%c",c);

       }
       c++;
       printf("\n");
    }
    getch();
}



   Alphabet pattern:6             

              A
              AB
              ABC
              ABCD            





#include<conio.h>
#include<stdio.h>
void main()
{
    int i,j,n;
    char c;
    clrscr();
    printf("Enter the number of lines to be printed: ");
    scanf("%d",&n);
    printf("\n\n");
    for(i=0;i<n;i++)
    {
       c='A';
       for(j=0;j<=i;j++)
       {
printf("%c",c++);
       }
       printf("\n");
     }
getch();
}


       
Alphabet pattern 7

A
     B C D
 E F G H I





#include<conio.h>
#include<stdio.h>
void main()
{
   int i,j,k,n;
   char c='A';
   clrscr();
   printf("\nEnter the no lines to be printed: ");
   scanf("%d",&n);
   printf("\n\n");
   for(i=0;i<n;i++)
   {
      for(j=0;j<(n-i-1);j++)
 printf("  ");
      for(k=0;k<(2*i+1);k++)
 {
 printf("%c ",c++);
 if(c>'Z')                              //Since no more alphbets should be printed
      exit();
 }
      printf("\n");
   }
}

Important alphabet pattern programs College tech fest or programming competion point of view.


 









#include<conio.h>
#include<string.h>
void main()
{
     char str[20];
      int i,j,k,len;
      printf("Enter the String: ");
      gets(str);
      len=strlen(str);
      puts(str);
      printf("");
      for(i=1;i<len-1;i++)
      {
            printf("%c",str[i]);
            for(j=0;j<len-2;j++)
                  printf(" ");
            printf("%c\n",str[len-i-1]);
      }
      strrev(str);
      puts(str);
}



This program is print the
 triangle of alphabets and in this program this are not random alphabets this is done by using fibonacci series.



//#include<conio.h>
#include<stdio.h>
void main()
{
     int i,j,sum=1,temp1=1,temp2=1,num;
     //clrscr();
     printf("Enter the number of lines to be printed");
     scanf("%d",&num);
     for(i=0;i<num;i++)
     {
for(j=0;j<=i;j++)
{
    printf("%c\t",(sum%26+65));
    sum=temp1+temp2; 
    temp2=temp1;                                      // fibonacci series
    temp1=sum;
}
     printf("\n");
     }

}

Similar programs:

pattern programs in c++ [alphabet pattern]

C++ Simple star pattern programs

pattern programs in c in star pattern
pattern programs in c in number pattern
How to solve [Code] Pattern Programs in C

Share your views regarding the given post via the comments section given below.
If you liked the post, please '+1' it & share it on other social networks.
Thank You.

135 comments:

  1. really nice.. carry on

    ReplyDelete
  2. Anonymous26 May, 2012

    plz help me with this pattern(if possible using 3 variables only)


    1a
    2b 3c
    4d 5e 6f
    7g 8h 9i 10j
    11k and so on....till n.

    ReplyDelete
  3. #include
    #include
    void main()
    {
    int v1=1,i,j;
    for(i=0;i<5;i++)
    {
    for(j=0;j<=i;j++)
    {
    printf(" %d%c ",v1,v1+64);
    v1++;
    }

    printf("\n");
    }
    }

    this is static program for 5 lines

    ReplyDelete
  4. #include
    #include
    void main()
    {
    int v1=1,i,j,num;
    printf("Enter the number of lines to be printed");
    scanf("%d",&num);
    for(i=0;i<num;i++)
    {
    for(j=0;j<=i;j++)
    {
    printf(" %d%c ",v1,v1+64);
    v1++;
    }

    printf("\n");
    }
    }

    this is better one but requires 4 variables

    ReplyDelete
  5. A C E G I K
    B D F H J
    l N P R T V
    M O Q S U

    ReplyDelete
  6. A C E G I K
    B D F H J
    l N P R T V
    M O Q S U

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      {
      int i,j,k;
      char c1='A',c2;
      for(i=0;i<2;i++)
      {
      c2=c1+1;
      for(j=0;j<6;j++)
      {
      printf("%c ",c1);
      c1=c1+2;
      }
      printf("\n");
      for(k=0;k<5;k++)
      {
      printf("%c ",c2);
      c2=c2+2;
      }
      c1--;
      printf("\n");
      }
      getch();
      }

      Delete
  7. Anonymous05 July, 2012

    can i get code for this


    a g
    A B F G
    a b c e f g
    A B C D E F G

    plz ...as soon as poossible.

    ReplyDelete
  8. please provide what would be input.
    logic is ready

    ReplyDelete
  9. This comment has been removed by the author.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. Please give C program to print the following diamond pattern from C to G

    G
    EFGFE
    CDEFGFEDC
    EFGFE
    G
    ReplyDelete

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,k;
      char c;
      printf("Enter any charcter");
      scanf("%c",&c);
      for(i=0;i<3;i++) //for upper triangle
      {
      for(j=c-2*i;j<=(c+2*i);j++)
      {
      printf("%c ",j);
      }
      printf("\n");
      }
      for(i=1;i>=0;i--) //for lower triangle
      {
      for(j=c+2*i;j>=(c-2*i);j--)
      {
      printf("%c ",j);
      }
      printf("\n");
      }
      getch();
      }

      Delete
  12. please tell the code to print this:
    A
    bcd
    EFGHI
    jklmnop

    ReplyDelete
  13. please tell the code to print this:
    A
    bcd
    EFGHI
    jklmnop

    ReplyDelete
    Replies
    1. #include
      void main()
      {
      int i,j,k=0;
      char c;
      printf("Enter the number of lines to be printed:");
      scanf("%d",&c);
      for(i=0;i<c;i++)
      {
      for(j=0;j<(2*i+1);j++)
      {
      if(i%2)
      printf("%c ",k+97);
      else
      printf("%c ",k+65);
      k++;
      }
      printf("\n");
      }
      getch();
      }

      Delete
  14. This comment has been removed by the author.

    ReplyDelete
  15. Can i get this pattern plzz!
    ....A
    ..ABA
    ABCBA
    ..ABA
    ....A

    (there should be space instead of dots
    2dots=1space)

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      ä
      int i,j,k,n;
      clrscr();
      printf("Enter number of lines to be printed");
      scanf("%d",&n);
      for(i=0;i0;i--)
      ä
      for(j=0;j<n-i;j++)
      ä
      printf(" ");
      ñ
      for(k=0;k<(2*i-1);k++)
      ä
      printf("%c ",k+65);
      ñ
      printf("Ön");
      ñ

      ñ

      Delete
  16. plz give me the logic to print a heart shaped stars

    ReplyDelete
  17. can u just print the sample heart of stars, i mean whats your output
    u can draw in comment and instead of blank space use dots

    ReplyDelete
  18. A
    22
    CCC
    3333
    EEEEE

    this pattern plzz!

    ReplyDelete
    Replies
    1. here is your code,optimize the code before using

      #include
      #include
      void main()
      {
      int no,i=0,j=2,k,count=0;
      printf("Enter the no of lines to be printd: ");
      scanf("%d",&no);
      while(1)
      {
      if(count==no)
      break;
      for(k=0;k<=count;k++)
      {
      printf("%c ",i+65);
      }
      printf("\n");
      count++;i=i+2;
      if(count==no)
      break;
      for(k=0;k<=count;k++)
      {
      printf("%d ",j);
      }
      printf("\n");
      j++;count++;
      }
      }

      Delete
  19. Can i have the coding for

    A
    1 2
    B C D
    3 4 5 6
    E F G H I ..and so on..

    thank you...

    ReplyDelete
  20. here is your code

    #include
    #include
    void main()
    {
    int i,j,n1=0,n2=1,n,num=1,count=0;
    char c='A';
    clrscr();

    printf("\nEneter the no of lines to be printed: ");
    scanf("%d",&n);
    while(1)
    {
    if(count++>=n)
    break;
    for(i=0;i<=n1;i++)
    {
    printf("%c",c++);
    }
    printf("\n");
    n1=n1+2;
    if(count++>=n)
    break;
    for(j=0;j<=n2;j++)
    {
    printf("%d",num++);
    }
    n2=n2+2;
    printf("\n");
    }
    getch();
    }

    ReplyDelete
  21. can i have the coding for
    input: 1
    output : A

    input :5
    output :ABCDE

    Input :27
    output:ABCDEFGHIJKLMNOPQRSTUVWXYZA

    ReplyDelete
    Replies
    1. here is your pattern

      #include
      #include
      void main()
      {
      int i,n;
      clrscr();
      printf("\nEneter the no of lines to be printed: ");
      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
      printf("%c ",i+65);
      }
      getch();
      }

      Delete
  22. please give me c++ code for producing the following designs using if statement
    a).&&&&&&&
    &&&&&
    &&&
    &

    b). &
    & &
    & &
    & &
    & &
    & & & & & & & & & &

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      {
      int i,j,n;
      clrscr();
      printf("\nEneter the no of lines to be printed: ");
      scanf("%d",&n);
      for(i=n;i>0;i--)
      {
      for(j=0;j<2*i-1;j++)
      printf("&");
      printf("\n");
      }

      getch();
      }

      Delete
  23. * * * *
    * * * *
    * * *
    * *
    * *
    *

    Is this pattern possible..???...Please Help....

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      {
      int i,j,k,n;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=n;i>0;i--)
      {
      if(i%2==0)
      {
      for(k=0;k<2;k++)
      {
      for(j=0;j<i;j++)
      {
      printf("*");
      }
      printf("\n");

      }
      }
      else
      {
      for(j=0;j<i;j++)
      printf("*");
      printf("\n");
      }
      }
      getch();
      }

      Delete
  24. want to print the following
    |....|
    |...c...|
    |....ch...|
    |....chm...|
    in c language using loops

    ReplyDelete
    Replies
    1. can you just give more information like how many dots are there in each line
      do you want to print '|' this symbol also
      Number of dots in each line uneven

      Delete
  25. i want code for:g h i j
    d e f
    b c
    a

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. #include
      #include
      void main()
      {
      int i,j,k,n;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      k=n*(n+1)/2;
      for(i=n;i>0;i--)
      {
      for(j=i;j>0;j--)
      {
      printf("%c",k+64);
      k--;
      }
      printf("\n");
      }
      getch();
      }

      Delete
  26. me too want code for this
    1
    41
    941
    16941
    2516941

    ReplyDelete
    Replies
    1. #include
      #include
      void main()
      {
      int i,j,k,n;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
      for(j=i;j>0;j--)
      {
      printf("%2d",j*j);
      }
      printf("\n");
      }
      getch();
      }

      Delete
  27. SIR, ALPHABETIC PATTERN IS OF FORM:
    g h i j
    d e f
    b c
    a
    but according to your code it prints:
    jhig
    fed
    cb
    a
    please checck....
    i want no. of spaces = no of line in both patterns
    please explain m e....

    ReplyDelete
  28. SIR, ALPHABETIC PATTERN IS OF FORM:
    g h i j
    d e f
    b c
    a
    but according to your code it prints:
    jhig
    fed
    cb
    a
    please checck....
    i want no. of spaces = no of line in both patterns
    please explain m e....

    ReplyDelete
  29. sorry for the bugs in the previous program

    here i solved it
    #include
    #include
    void main()
    {
    int i,j,k,n,l;
    clrscr();
    printf("Enter the number of lines to be printed: ");
    scanf("%d",&n);
    k=n*(n+1)/2; //according to sum of series formula you will get value of k
    for(i=n;i>0;i--)
    {
    k=k-i;
    for(l=n-i;l>0;l--)
    {
    printf(" ");
    }
    for(j=i;j>0;j--)
    {
    printf("%c",k+65);
    k++;
    }
    k=k-i;
    printf("\n");
    }
    getch();
    }

    i want no. of spaces = no of line in both patterns
    i didn't understood your this statement

    if you want to show spaces use "." instead of spaces

    ReplyDelete
  30. nothing thanx ... a.. lot..
    please give me code of this one:
    0
    12
    340
    1234
    01234

    ReplyDelete
  31. nothing thanx ... a.. lot..
    please give me code of this one:
    0
    12
    340
    1234
    01234

    ReplyDelete
    Replies
    1. here is your code

      #include
      #include
      void main()
      {
      int i,j,k=0,n;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=1;i<=n;i++)
      {
      for(j=1;j<=i;j++)
      {
      printf("%d",(k++)%5);

      }
      printf("\n");
      }
      getch();
      }

      Delete
  32. Please provide me with the code to print
    *
    *@
    *@*
    by using number of lines to be printed ...

    ReplyDelete
    Replies
    1. here is your pattern

      #include
      #include
      void main()
      {
      int i,j,n;
      clrscr();
      printf("\nEneter the no of lines to be printed: ");

      scanf("%d",&n);
      for(i=0;i<n;i++)
      {
      for(j=0;j<=i;j++)
      {
      if(j%2==0)
      printf("*");
      else
      printf("@");
      }
      printf("\n");
      }
      getch();
      }

      Delete
  33. please help me in this following pattern..
    * * * *
    * * *
    * *
    *
    * *
    * * *
    * * * *

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,n,k;
      clrscr();
      printf("\nEnter the no of lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=0;i<n;i++)
      {
      for(j=0;j<n-i;j++)
      {
      printf("*");
      }
      printf("\n");
      }
      for(i=1;i<n;i++)
      {
      for(j=0;j<=i;j++)
      {
      printf("*");
      }
      printf("\n");
      }
      getch();
      }

      Delete
  34. sir can u plz tell me the solution of the following program
    Z
    Y Z Y
    X Y Z Y X
    W X Y Z Y X Z
    X Y Z Y X
    Y Z Y
    Z

    ReplyDelete
    Replies
    1. here is your code

      #include
      void main()
      {
      int i,j,k,n,l;
      clrscr();
      printf("\nEnter the no lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=0;i0;j--) if you want spaces
      // printf(" ");
      for(k=n-i;k<=n;k++)
      {
      printf("%c ",90-n+k); //90 is ascii of Z
      }
      for(l=1;l<=i;l++)
      {
      printf("%c ",90-l);
      }
      printf("\n");
      }
      }

      Delete
  35. sir can u plz tell me the solution of the following program

    *
    * *
    * *
    * *
    * * * * *

    *
    * *
    * *
    * *
    * *
    * *
    * *
    * *
    *

    ReplyDelete
    Replies
    1. #include

      int main(void) {
      // your code goes here
      int i,j,n;
      printf("enter number of rows\n");
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
      if(i==1)
      {
      printf("*");
      printf("\n");
      }
      else
      {
      for(j=1;j<=2;j++)
      {
      printf("*");
      }
      printf("\n");
      }
      if(i==n)
      {
      printf("*");
      }

      }
      return 0;
      }

      Delete

  36. ----*
    ---*-*
    --*---*
    -*-----*
    *-*-*-*-*

    OOOOORRRRRR


    ----*
    ---*-*
    --*---*
    _*-----*
    *-------*
    -*-----*
    --*---*
    ---*-*
    ----*

    Here, instead of _ set SPACE....

    ReplyDelete
    Replies
    1. http://www.programmingspark.com/2012/01/pattern-programs-in-c-pattern-26.html

      Both the programs are already present over here

      Delete
  37. Replies
    1. here is your pattern

      #include
      #include
      void main()
      {
      int i,j,n;
      char c;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=0;i=0;j--)
      {
      printf("%c",c++);
      }
      printf("\n");
      }
      getch();
      }

      Delete
    2. Above code will not work sorry for the inconvenience
      there is some problem some lines are not being printed like for loop line is changed
      just provide me your email id I will mail you up

      Delete
  38. Plz help
    A
    A B
    A B C
    AB C D
    AB C
    AB
    A

    ReplyDelete
  39. can u help me in printing
    GOODLUCK
    GOODLUC
    GOODLU
    GOODL
    GOOD
    GOO
    GO
    G

    ReplyDelete
    Replies
    1. #include
      #include
      #include
      void main()
      {
      int i,j,n,k;
      char c[20];
      clrscr();
      printf("Enter the String: ");
      gets(c);
      printf("\n");
      n=strlen(c);
      for(i=0;i<n;i++)
      {
      for(j=0;j<n-i;j++)
      {
      printf("%c",c[j]);
      }
      printf("\n");
      }
      getch();
      }

      Delete
  40. 1 2 3 4 5
    16 17 18 19 6
    15 24 25 20 7
    14 23 22 21 8
    13 12 11 10 9
    it's clock wise pattern and user's input will be n so can you help me on this pattern?

    ReplyDelete
    Replies
    1. The spiral should comprise of digits 0 to 9, starting from 0 incrementing by one.

      Delete
    2. http://www.programmingspark.com/2012/10/c-program-to-print-spiral-pattern.html here the program is present

      Delete
    3. The spiral should comprise of digits 0 to 9, starting from 0 incrementing by one.

      I am not getting the above line can you just elaborate what do you want?

      Delete
  41. Guys sorry for the inconvenience, as I will not be able to answer your question till 15 dec as my exams are going on.
    -ADMIN

    ReplyDelete
  42. can you plz help me out in this pattern..

    A B C D E F G F E D C B A
    A B C D E F F E D C B A
    A B C D E E D C B A
    A B C D D C B A
    A B C C B A
    A B B A
    A A

    ReplyDelete
    Replies
    1. void main()
      {
      int i,j,k,n;
      char c;
      clrscr();
      printf("Enter the number of lines to be printed: ");
      scanf("%d",&n);
      printf("\n\n");
      for(i=0;i=0;k--)
      {
      printf("%c",c--);
      }
      printf("\n");
      }
      getch();
      }

      Delete
  43. CAN I HAVE THE CODE FOR
    10
    8 10
    6 8 10
    4 6 8 10

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. CAN I HAVE THE CODE FOR
    bbbbbbb10
    bbbbb8 10
    bbb6 8 10
    b4 6 8 10

    b stands for blankspace.

    ReplyDelete
    Replies
    1. #include
      void main()
      {
      int i,j,n,k,m=10;
      clrscr();

      printf("Enter the number of lines to be printed not more than 5: ");
      scanf("%d",&n);
      printf("\n");
      for(i=0;i<n;i++)
      {
      for(j=0;j<2*(n-i)-1;j++)
      {
      printf(" ");
      }
      for(k=0;k<=i;k++)
      printf("%2d",m-2*(i-k));
      printf("\n");
      }
      getch();
      }

      Delete
  46. can i have the code for..
    Aa
    Bb Bb
    Cc Cc Cc

    ReplyDelete
  47. can ihav code for

    A B C D E G F
    B C D E G
    C D E
    D
    plz provide as soon as possible.

    ReplyDelete
    Replies
    1. #include
      void main()
      {
      int i,j,n,k;
      char c;
      printf("\nEnter the no of lines to be
      printed: ");
      scanf("%d",&n);
      for(i=0;i=0;k--)
      {
      printf("%c",c);
      c++;
      }
      printf("\n");
      }
      }

      Delete
    2. Sorry the for loop line is not getting printed
      So here it is
      for(k=2*(n-i-1);k greater than equal to 0;k--)

      Delete
  48. This comment has been removed by the author.

    ReplyDelete
  49. write a program to print............
    abcdefg
    abc efg
    ab fg
    a g

    ReplyDelete
  50. How to Print
    A
    ABA
    CBABC
    DCBABCD
    EDCBABCDE

    ReplyDelete
  51. can u please help me with the following pattern
    A
    BAB
    CBABC
    DCBABCD
    EDCBABCDE
    DCBABCD
    CBABC
    BAB
    A

    i am finding it quite difficult to do

    ReplyDelete
    Replies
    1. A would be in the center and the other alphabets around it

      Delete
    2. wassup tondaat?

      Delete
    3. i am not able to get the pattern

      Delete
    4. #include

      int main(void) {
      // your code goes here
      int i,j,n,temp;
      printf("enter number of rows\n");
      scanf("%d",&n);
      char c='A';
      for(i=0;i=1;i--)
      { c='A'+temp-1;
      for(j=temp;j>=1;j--)
      {
      printf("%c",c);
      c--;
      }
      c++;
      for(j=temp;j>1;j--)
      {
      c++;
      printf("%c",c);
      }
      temp--;
      printf("\n");
      }
      return 0;
      }

      Delete
  52. guys i am not able to comment properly as "less than " sign is not getting printed in this template so please provide your email and solution will be provided to you on your mail.
    no spam mails will be send.

    ReplyDelete
  53. Can you give this pattern please.
    A
    BB
    CCC
    DDDD
    EEEE!

    ReplyDelete
    Replies
    1. Its the second program of this page

      Delete
  54. kindly send me the mail of this code at jene.patil@gmail.com

    ReplyDelete
  55. Code for The fallowing
    10-8-6-4-2
    8-6-4-2
    6-4-2
    4-2
    2

    ReplyDelete
    Replies
    1. #include

      int main(void) {
      // your code goes here
      int i,j,n,k;

      printf("enter number of rows\n");
      scanf("%d",&n);
      int temp=2*n;
      for(i=0;i0;)
      {
      printf("%d",j);
      if(j>2)
      printf("-");
      j=j-2;
      }
      temp=temp-2;
      printf("\n");

      }

      return 0;
      }

      Delete
  56. Osama Farooqui30 March, 2013

    I forget to mention that in the following pattern user will give the character on the run time like "E" on the following pattern

    ReplyDelete
  57. Write a program that output the
    following:

    A
    * *
    B C D
    * * * *
    E F G H I

    * * * * * *

    ReplyDelete
  58. #include

    void main()

    {

    int i,j,k,n;

    char c='A';

    cout<<"Enter the no lines to be printed: ";

    cin>>n;

    cout<'Z')

    c='A';

    }

    cout<<"\n";

    for(j=0;j<=2*i+1;j++)

    cout<<'*';

    cout<<"\n";

    }

    }

    ReplyDelete
  59. as there is some problem with comment section
    solution has been mailed to you

    ReplyDelete
  60. please provide us a code for

    A
    a b
    A B C
    a b c d
    A B C D E

    ReplyDelete
  61. Anonymous05 June, 2013

    Please provide code...

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    Q
    R
    S
    T
    U
    V
    W
    X
    Y
    Z
    AA
    BA
    CA
    ...
    ..
    ...
    ..
    ...
    ...
    .

    ReplyDelete
  62. give me code of this as soon as possible plz
    123454321
    1234 4321
    123 321
    12 21
    1 1

    ReplyDelete
  63. This comment has been removed by the author.

    ReplyDelete
  64. Hey please can you gimmi d code for:
    Enter no. of lines-eg:If user enters 4 then there shud be 4 'Z' in the beginning like:

    ZZZZ
    YYY(Z-1)
    XX(Z-2)
    W(Z-3)

    ReplyDelete
  65. Give me the code for the output given below:
    A B C D E F G F E D C B A
    A B C D E F F E D C B A
    A B C D E E D C B A
    A B C D D C B A
    A B C C B A
    A B B A
    A A

    ReplyDelete
    Replies
    1. #include

      int main(void) {

      int i,j,n,k;

      printf("enter number of rows\n");
      scanf("%d",&n);
      int temp=n;
      for(i=0;i<=n;i++)
      { char c='A';
      for(j=0;j<temp;j++)
      {
      printf("%c",c);
      c++;
      }

      for(k=0;k<temp;k++)
      {
      c--;
      printf("%c",c);
      }
      temp--;
      printf("\n");
      }
      return 0;
      }

      Delete
  66. This comment has been removed by the author.

    ReplyDelete
  67. pls help to display in c
    a b c d e
    b c d
    c

    ReplyDelete
  68. Sir, How to print this pattern in c? plz tell
    A B C D E D C B A
    A B C D C B A
    A B C B A
    A B A
    A

    ReplyDelete
    Replies
    1. #include

      int main(void) {

      int i,j,n,k;
      char c='A';
      printf("enter number of rows\n");
      scanf("%d",&n);
      int temp=n;
      for(i=1;i<=n;i++)
      {
      for(j=1;j<=temp;j++)
      {
      printf("%c",c);
      c++;

      }
      c--;
      for(j=1;j<temp;j++)
      {
      --c;
      printf("%c",c);

      }
      temp--;
      printf("\n");
      }
      return 0;
      }

      Delete
  69. sir plz tell abt this?
    2. Generate Fibonacci series from 1 to 100 and print it in reverse order.

    ReplyDelete
  70. 5. Write an efficient program to reverse characters of each word in a file and write an output file in the same format with all words reversed.

    ReplyDelete
  71. Sir can you tell this?
    6. Work out an algorithm to predict the best times to buy and sell a stock over a 60-day period. Use a suitable data structure so that the “n” th element is the price of the stock on day “n”.
    ex. 1st element is stock price on day one, 60th element is stock price on day 60.Assume that you start out with 10,000 INR, and value of stock on day 1 is INR 10. Make up any data that you wish for the stock prices. Please provide the input dataset and a working program.

    ReplyDelete
  72. Sir can you tell this?
    6. Work out an algorithm to predict the best times to buy and sell a stock over a 60-day period. Use a suitable data structure so that the “n” th element is the price of the stock on day “n”.
    ex. 1st element is stock price on day one, 60th element is stock price on day 60.Assume that you start out with 10,000 INR, and value of stock on day 1 is INR 10. Make up any data that you wish for the stock prices. Please provide the input dataset and a working program.

    ReplyDelete
  73. sir plz tell abt this?
    2. Generate Fibonacci series from 1 to 100 and print it in reverse order.

    ReplyDelete
  74. Sir, How to print this pattern in c? plz tell
    A B C D E D C B A
    A B C D C B A
    A B C B A
    A B A
    A

    ReplyDelete
    Replies
    1. #include

      int main(void) {

      int i,j,n,k;
      char c='A';
      printf("enter number of rows\n");
      scanf("%d",&n);
      int temp=n;
      for(i=1;i<=n;i++)
      {
      for(j=1;j<=temp;j++)
      {
      printf("%c",c);
      c++;

      }
      c--;
      for(j=1;j<temp;j++)
      {
      --c;
      printf("%c",c);

      }
      temp--;
      printf("\n");
      }
      return 0;
      }

      Delete
  75. this pattern
    **********
    **** ****
    *** ***
    ** **
    * *
    * *
    ** **
    *** ***
    **** ****
    **********

    ReplyDelete
  76. Sir How to print this Pattern

    A
    C E
    G I K
    M O Q S

    ReplyDelete
  77. AAAAA
    BBBB
    CCC
    DD
    E

    plz code for it

    ReplyDelete
  78. *
    * *
    * * *
    \\\\* * * *

    where \\\\ indicate space

    ReplyDelete
    Replies
    1. #include

      int main(void) {
      // your code goes here
      int i,j,k,n,num=1;

      printf("enter number of lines\n");
      scanf("%d",&n);

      for(i=1;i<=n;i++)
      {
      for(j=1;j<=i;j++)
      {
      if(num==n)
      {
      for(k=1;k<=n;k++)
      {
      printf(" ");
      num--;
      }

      }


      printf("*");
      }
      num++;
      printf("\n");
      }
      return 0;
      }

      Delete
  79. ****
    * *
    ****
    *
    *
    *

    Can this pattern should b print

    ReplyDelete
  80. *
    * *
    * * * *
    * *
    how to print this pattern?

    ReplyDelete
  81. *
    * *
    * * * *
    * *
    how to print this pattern?

    ReplyDelete
  82. C
    LCO
    ELCOM
    WELCOME

    IN two loop get urgent

    ReplyDelete
  83. This comment has been removed by the author.

    ReplyDelete
  84. can u provide code for
    ......A
    ....AB
    ..ABC
    ABCD
    here dots= space
    here is my email id shailpancholi@hotmail.com

    ReplyDelete
    Replies
    1. #include

      int main(void) {

      int i,j,n,k;

      printf("enter number of rows\n");
      scanf("%d",&n);
      int temp=n;
      for(i=1;i<=n;i++)
      { char c='A';
      for(j=1;j<=2*temp-2;j++)
      {
      printf(" ");
      }

      for(j=1;j<=i;j++)
      {
      printf("%c",c);
      c++;
      }
      temp--;
      printf("\n");
      }
      return 0;
      }

      Delete
  85. EEEEE

    DDDD

    CCC

    BB

    A

    BB

    CCC

    DDDD

    EEEEE
    can any one tell the code of this??

    ReplyDelete
  86. aa
    abab
    abcabc
    abab
    aa
    please can anyone tell this.....

    ReplyDelete
  87. A
    BAB
    CBABC
    DCBABCD
    PLZ HELP ME PLZZ PLZZZ :(

    ReplyDelete
  88. WAP OF FOLLOWING PATTERN...

    A A
    AB BA
    ABCBA
    AB BA
    A A

    ReplyDelete
  89. This comment has been removed by the author.

    ReplyDelete
  90. plz help me with this pattern(if possible using 3 variables only)
    1a
    1a 2b
    1a 2b 3c
    1a 2b 3c 4d and so on....till 26z.

    ReplyDelete
  91. This comment has been removed by the author.

    ReplyDelete
  92. ABCDEFGFEDCBA
    ABCDEF FEDCBA
    ABCDE EDCBA
    ABCD DCBA
    ABC CBA
    AB BA
    A A

    ReplyDelete

Back To Top