C-programming - Display multiplication table of a given number, C programming to display tables
Display multiplication table of a given number
To display multiplication table we use for loop in our program.coding:
#include<stdio.h> #include<conio.h> int main() { int n,i,res; printf("enter a number to display its tables"); scanf("%d",n); printf("tables "); for(i=0;i<n;i++) { res=n*i; printf("%d*%d=%d ",n,i,res); } getch(); }
Output
enter a number to display its tables5 tables 5*0=0 5*1=5 5*2=10 5*3=15 5*4=20 5*5=25 5*6=30 5*7=35 5*8=40 5*9=45 5*10=50
The topic on C-programming - Display multiplication table of a given number is posted by - Kani
Hope you have enjoyed, C-programming - Display multiplication table of a given numberThanks for your time