Monday 6 August 2012

Loop control structure005


Write a program to print a multyplication table of an input number.

#include <stdio.h>
#include <conio.h>


void main ( )
{
        long              no, co = 1, ans;
        clrscr ( );
 
        printf ("\n\t Enter the number.......:"); scanf ("%ld",&no);
        clrscr ( );
        printf ("\n\t MULTYPPLICATION TABLE OF %ld", no);
        printf ("\n\t ==========================");
          
        while ( co <= 15 )
        {                           
                       ans = no * co;
                       printf ("\n\t %ld \t X \t%ld = \t%ld\n",no, co, ans);
                       co ++;
        }
        printf ("\n\t ==========================");
        getch ( );


No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...