C Program to generate Multiplication Table



Multiplication Table, C Program , Sumit Kar, Timusa Rak



#include <stdio.h>

#include <conio.h>

#define ROWS 10

#define COLUMNS 10

void main()

   {

    int   row, column, product[ROWS][COLUMNS] ;

    int   i, j ;

    printf("\n              MULTIPLICATION TABLE \n\n") ;

    printf("    ") ;

    for( j = 1 ; j <= COLUMNS ; j++ )

       printf("%4d" , j ) ;

    printf("\n") ;

    printf("---------------------------------------------\n");

    for( i = 0 ; i < ROWS ; i++ )

       {

       row = i + 1 ;

       printf("%2d |", row) ;

       for( j = 1 ; j <= COLUMNS ; j++ )

  {

  column = j ;

  product[i][j] = row * column ;

  printf("%4d", product[i][j] ) ;

  }

    printf("\n") ;

   }

       getch();









   }
















#include<stdio.h>



#include<conio.h>



int main()



{



 int x=1,num,res;



 printf("Enter Number : ");



 scanf("%d",&num);



 while(x<=10)



 {



   res=num*x;



   printf("\n%d*%d=%d",num,x,res);



   x++;



 }



 getch();



 return 0;



}














Comments

Popular posts from this blog

Write a Program to Add two 3x3 Matrix using C

C program for Unit Conversion

Write a Program to Add two 5x5 Matrix using C