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>>>>>>>>>

Sunday 12 January 2014

PYRAMID OF STARS

C program to print PYRAMID of stars


Pyramid of stars



main()
{
int i,j,n,space;

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

                                   TRY THIS

     Right angled triangle of numbers>>>>

Tuesday 7 January 2014

RIGHT ANGLED TRIANGLE OF NUMBERS

Write a C program to print c program to print right angled triangle of Numbers.


1234
123
12
1




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



                            TRY THIS

RIGHT ANGLED TRIANGLE OF NUMBERS

write a C program to print right angled triangle of Numbers

1
12
123
1234
12345





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("%d",j);
}
printf("\n");
}
getch();
}
                                           TRY THIS


                  Graph Coloring problem using backtracking Method>>>