PROGRAM TO MAKE A PATTERN


/* INPUT =5
*
12
***
123
****
12345
*/

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,j;
clrscr();
printf("enter numbers\n");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=i;j++)
{
if(i%2==0)
printf("%d",j);
else
printf("*");

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

SIMPLE PROGRAMS
FUNCTIONS


NUMBERS


STRINGS AND CHARACTERS


Comments