Monday, 20 July 2020

Table multiplication of given number

Q : Write program to generate multiplication table for first ‘n’  number, where ‘n’ is a user input.


Answer : 



#include<stdio.h>
#include<conio.h>
/*============================
     Girfa Student Help
     Multiplication table of given number
==============================*/


void main()
{
     int n, i;
     clrscr();
     printf("Enter an integer: ");
     scanf("%d", &n);
     for (i = 1; i <= 10; ++i) {
           printf("%d * %d = %d \n", n, i, n * i);
     }
     getch();
}


No comments:

Post a Comment