Thursday

Write a C program to read a positive number integer less than 20 and display its multiplication table.

#include<stdio.h>
#include<conio.h>
void main()
  {
    int n,i;
    clrscr();
    printf("\n Enter positive number less than 20:");
    scanf("%d",&n);
    if(n>0 && n<20)
    {
    for(i=1;i<=10;i++)
    printf("\n%d X %d = %d",n,i,n*i);
    }
    else
    printf("\n Invalid number");

  getch();
  }

No comments:

Post a Comment

Rahul-Notes