Translate

Labels

Wednesday, 29 January 2014

CURRENT DATE

A C program to print Current Date


main()
{
printf("Current date is: %s",__DATE__);
}

CURRENT TIME

A C program to print Current time



main()
{
printf("Current time is: %s",__TIME__);
}

ALPHABET PATTERN_3

A C program to print following pattern


ABCDE
ABCD
ABC
AB
A


main()
{
int ,i,j,n;
clrscr();
printf("Enter the number of rows:");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
printf("%c",'A'+j-1);
}
printf("\n");
}
getch();
}

Sunday, 26 January 2014

ALPHABET PATTERN_2

A C program to print the following pattern:
E
DE
CDE
BCDE
ABCDE


main()
{
int i,j,n;
printf("Enter the number of rows:");
scanf("%d",&n);
for(i=n;i>=1;i--)
{
for(j=i;j<=n;j++)
{
printf("%c",'A'+j-i);
}
printf("\n");
}
getch();
}

Thursday, 23 January 2014

ALPHABET PATTERN_1

A C program to print the following alphabet pattern

A
AB
ABC
ABCD
ABCDE

main()
{
int i,j,n;
clrscr();
printf("Enter the number of rows:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
printf("%c",'A'+j-1);
}
printf("\n");
}
getch();
}


Thursday, 16 January 2014

STAR PATTERNS

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

for this pattern

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

for this pattern

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

for this pattern

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

for this pattern

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

for this pattern

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

for this pattern

Wednesday, 15 January 2014

DIAMOND PATTERN STARS IN C

A C program to print Diamond pattern stars .

Diamond of Stars


main()
{
int rows,i,j,space;
clrscr();
printf("Enter the number of Rows:");
scanf("%d",&rows);
space=rows-1;
for(i=1;i<=rows;i++)
{
for(j=1;j<=space;j++)
{
printf(" ");
}
space--;
for(j=1;j<=2*i-1;j++)
{
printf("*");
}
printf("\n");
}
space=1;
for(j=1;j<=rows-1;j++)
{
for(i=1;i<=space;i++)
{
printf(" ");
}
space++;
for(i=1;i<=2*(rows-j)-1;i++)
{
printf("*");
}
printf("\n");
}
getch();
}
                                   

                                                        TRY THIS

                                        Pyramid of Stars>>>>>>>>>