Friday, April 10, 2015

10. Draw a flowchart and write a C program to read in a positive integer less than 20 and display its multiplication table.


#include<stdio.h>
#include<conio.h>
void main()
{
int i,n;
clrscr();
printf("\n Input any number:-");
scanf("%d",&n);
if(n<20)
{
for(i=1;i<=10;i++)
  printf("\n %2d x %2d=%3d",n,i,n*i);
}
else
printf("\n Invalid number");
getch();
}

No comments:

Post a Comment