Code Box
---------------------------------------------
/*Program to print table of any input number*/
#include<stdio.h>
#include<conio.h>
void main()
{
int num,i,mul;
i=1;
clrscr();
printf("\nEnter any number:");
scanf("%d",&num);
clrscr(); //for clear screen
printf("\n-------------------------------");
printf("\nNumber entered is: %d",num);
printf("\n-------------------------------");
printf("\nTable of %d is",num);
printf("\n---------------------------------------\n");
do
{
if(num==0)
{
printf("\nZero entered");
break;
}
mul=num*i;
printf("\n %d x %d = %d ",num,i,mul);
i++;
}while(i<=10);
printf("\n--------------------------------------");
getch();
}
No comments:
Post a Comment