Q. Generate a multiplication table of a number entered by a user
==> Code goes like this :
/* Multiplication table of entered number */
#include<stdio.h>
int main()
{
int i,num;
printf("\n Enter the number:");
scanf("%d",&num);
for(i=1;i<=10;i++)
{
printf(" %d x %d = %d \n",num,i,num*i);
}
printf("\n");
return 0;
}
Output:
I have used Dev CPP to compile this program.
If you are using Turbo C++ IDE, then use conio.h in link section after stdio.h
and use getch(); to hold the output screen, just before the end of main function.
If you have any confusion regarding the program, please, comment below.
Happy Coding !
Thank you
Multiplication table of entered number in C
9:44 PM
C Programs
,
multiples printing.
,
multiplication table in C
,
Multiplication table printing
Edit
0 comments:
Post a Comment