#include<conio.h>
#include<stdio.h>
int i,j;
void first();
void second();
void main()
{
char ch;
printf("\n\n\n\t\tpress 1 for first program:\n\n\t\t");
printf("press 2 for first program:\n\n\n\t\t");
ch=getch();
switch(ch)
{
case'1':
first();
break;
case '2':
second();
break;
}
}
void first()
{
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("\n");
}
}
void second()
{
for(i=1;i<=5;i++)
{
for(j=1;j<=i;j++)
{
printf("%d",j);
}
printf("1");
}
}
0 comments:
Post a Comment