<body><iframe src="http://www.blogger.com/navbar.g?targetBlogID=12834578&amp;blogName=In+search+of+absolute&amp;publishMode=PUBLISH_MODE_BLOGSPOT&amp;navbarType=BLUE&amp;layoutType=CLASSIC&amp;homepageUrl=http%3A%2F%2Fmnjaga.blogspot.com%2F&amp;searchRoot=http%3A%2F%2Fmnjaga.blogspot.com%2Fsearch" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" height="30px" width="100%" id="navbar-iframe" title="Blogger Navigation and Search"></iframe> <div id="space-for-ie"></div>

Example C Program to print any Multiplication Table

23 November, 2006
/******************************************
 * C Program to print MultiplicationTable         *
 * Author of the Program: Jagadeesh, M.N.     *
 * Date 23 Nov 2006                                        *
 * ***************************************/
#include<stdio.h>
main()
{
        int i, p=1, table[10];     /* define integres and array */

        /* ***************************
         * Output Formating Begins
         * ***************************/
        for(i=0;i<61;i++)
                printf("#");
        printf("\n#  Program to print Multiplication table of any number");
        printf("\n#  NOTE: To exit type 0 \n");
        for(i=0;i<61;i++)
                printf("#");
        /* ***************************
         * Output Formating ENDS
         * ***************************/
        while(p != 0)
        {
        printf("\nWhich table ");
        scanf("%d",&p);              /* takes input from input */
        for(i=0;i<10;i++)            /* Fills the array */
        {
                if(p==0)             /* Stratagy to exit the program Benins */
                {
                        printf("Exiting\n");
                        break;
                }                   /* Stratagy to exit the program ends */
                table[i]=i+1;       /* Fills the array with numbers 1 - 10 */
                printf("%2d x %2d = %2d\n", p, table[i], p * table[i]);
        }
        }
}



Comments:
dear friend,

in your code, u need some validation for input, just coz your array is 10.
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?