« Previouns Programfollowing routine »

In this tutorial, you will certainly Learn and gain code around printinns the tmay be in following ways:

Publish Table that a offered NumberPublish Tmaybe from 1 come 10Print Table that every number in offered Range

C Publish Tmay be that a provided Number

to Print the tmay be that any number in C programming, you have to ask native user come Enter any number. Climate multiply ns number via 1 come 10 and also display screen ns multiplicati~ above outcome at the moment the multistrong the number with 1, 2, 3, ...., 9, 10 as shown below in ns routine provided below.

the Inquiry is, compose a routine in C to get any type of number from user (in ~ run-time) and Publish itns table.here ins the answer of this question:




You are watching: How to make a table in c++

#include#includeinns main() int num, i, tab; printf("Enter the number: "); scanf("%d", &num); printf(" Tmay be the %d is: ", num); for(i=1; iprintf("%d * %2d = %2d ", num, i, tab); getch(); rerevolve 0;}
as ns program was created under Code::Blocks IDE, Therefore ~ effective develop and run, girlfriend will certainly obtain the following output:


*

supply any number to speak 5 and also push Get in crucial to check out the tmay be of 5 together offered in the 2nd snapshot that the sample run:



regimen Explainedreceive any kind of number as inPut to speak 5 to Publish ns tmaybe of 5within the for loop, main point the number through the value the i and also initialize ins come one more variable say tabclimate Publish ns worth that tab together outPut every and eincredibly tins after ~ multiplicati~ above and also initializati~ above inside the for loopright here at first time, i holdns 1 and then tab will certainly organize num*i or 5*1 or 5at 2nd time, i holdns 2 and also climate tab will certainly organize num*i or 5*2 or 10In this method tab will certainly hold, 5, 10, 15, ..., 45, 50

C Print Tmay be from 1 come 10

This regimen will certainly Publish tmaybe native 1 to 10:


#include#includeint main() inns num=1, res, i, j; printf(" Tmay be native 1 to 10 "); for(i=0; iprintf("Tmaybe that %d = ", num); for(j=1; jprintf("%d ", res); printf(" "); num++; } getch(); rerevolve 0;}


C Publish Tmaybe in given Range

Let"ns develop an additional routine the will certainly also Print ns tmaybe the number. But thins time, the routine will ask come Go into ns variety (starting and also finishing number). The tmay be that every the numbers that come in between these two provided number (including both), will certainly gets published together output:


#include#includeint main() int n1, n2, i, j; printf("Go into ns value that n1 (founding point): "); scanf("%d", &n1); printf("Enter ns value that n2 (finishing point): "); scanf("%d", &n2); for(i=n1; iprintf("Tmaybe of %d: ", i); for(j=1; jprintf("%d x %d = %d ", i, j, i*j); printf(" "); } getch(); rerotate 0;}


See more: Broke Bitch Broken Ass Nose Bitch, Broken Ass Nose Bitch", Still Softish Lyrics By Josh Richards


now supply any type of 2 number speak 2 and also 3 as founding and ending suggest and push Enter to check out ns output. The outPut will it is in ns tmaybe of 2 and 3: