C Program to Read Positive Integer Less than 20 and Display Multiplication Table

0
6
digitalample eye
Write a C program to read in a positive integer less than 20 and display its multiplication table.

C Program to Read Positive Integer Less than 20 and Display Multiplication Table
Source Code, 

#include <stdio.h>
#include <conio.h>
void main()
{
int i,num;
clrscr();
printf("Enter a positive integer less than 20");
scanf("%d",&num);
if(num<20)
{
for(i=1;i<=10;i++)
{
printf("n%d*%d=%d",num,i,i*num);
}
}
else
printf("Enter the number less than 20 only");
getch();
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here