int i = 0,j = 0;
short k = 0;
int Integers(int no)
{
printf("+----------------------------+\n\tIntegers\n+----------------------------+\n");
for(i = 1; i < no; i++)
{
printf("%d ",i);
if(i - j == 10)
{
printf("\n----------------------------+\n");
j = i;
}
}
}
int Even_numbers(int no)
{
j = 0;
printf("----------------------------+\n\tEven Numbers\n----------------------------+\n");
for(i = 0; i < no; i+=2)
{
printf("%d ",i);
if(i - j == 20)
{
printf("\n----------------------------+\n");
j = i;
}
}
}
int Odd_numbers(int no)
{
j = 1;
printf("----------------------------+\n\tOdd Numbers\n----------------------------+\n");
for(i = 1; i < no; i+=2)
{
printf("%d ",i);
if(i - j == 20)
{
printf("\n----------------------------+\n");
j = i;
}
}
}
main()
{
int choice = 0,a = 0;// variable declaration and initialization
printf("Size of Char %d\n",sizeof(int short));
do // do-while loop
{
printf("\nPlease Enter Any +ve No\n");
scanf("%d",&a);
printf("\nTo Print 1-100 Press --> 1\nTo Print Even numbers from 1-100 Press --> 2\nTo Print Odd numbers from 1-100 Press --> 3\n");
printf("Enter Your Choice --> ");
scanf("%d",&choice);
switch(choice)
{
case 1:
Integers(a);// Function Calling
break;
case 2:
Even_numbers(a);// Function Calling
break;
case 3:
Odd_numbers(a);// Function Calling
break;
default:
printf("Please Enter the Valid Choice\n");
}// switch
printf("\n\nTo Continue Press 1 Else Other to Exit\n");
scanf("%d",&choice);
} while(choice == 1);
printf("Bye......\n");
}