Print Table on any Number in C

Google Advertisements

Prev Tutorial Next Tutorial

Print Table of Any Number Program in C

The concept of generating table of any number is, particular number is multiply from 1 to 10.

The concept of generate Table of any number is :
number * 1
number * 2
number * 3
number * 4
number * 5
number * 6
number * 7
number * 8
number * 9
number * 10

Find table of any number

Find Table of any Number in C

#include<stdio.h>
#include<conio.h>

void main()
{
int i,no,table=1;
clrscr();
printf("Enter any number : ");
scanf("%d",&no);
printf("Table of  %d \n",no);
for(i=1;i<=10;i++)
{
table=no*i;
printf("%d",table);
printf("\n");
}
getch();
}

Output

Enter any number : 5
Table of 5
5
10
15
20
25
30
35
40
45
50

Explanation of Program

Code

for(i=1;i< =10;i++)
{
table=no*i;
printf("%d",table);
printf("\n");
}

In the above Code execute for loop from 1 to 10, and given number is multiply by 1 and next iteration number is multiply by 2 and at third iteration number is multiply by 3,........10. and finally results are print on screen

Find table of any number using while loop

Table of any Number using while loop

#include<stdio.h>
#include<conio.h>

void main()
{
int a=1,no,table=1;
clrscr();
printf("Enter any num: ");
scanf("%d",&no);
while(a<=10)
{
table=a*no;
printf("%d",table);
printf("\n");
a++;
}
getch();
}

Output

Enter any num: 2
Table
2
4
6
8
10
12
14
16
18
20

Find table of any number using recursion

Program to print table of any number using recursion

#include<stdio.h>
#include<conio.h>

void main()
{
int table(int,int);
int n,i;
clrscr();
printf("Enter any num: ");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
printf(" %d*%d= %d\n",n,i,table(n,i));
}
getch();
}
int table(n,i)
{
int t;
if(i==1)
{
return(n);
}
else
{
return(table(n,i-1)+n);
}
}

Prev Tutorial Next Tutorial

Google Advertisements

We have more than 5 Groups which have 500000+ Members and some Pages have more than 100000+ members. If you want to post your article on our website/FB Group/FB Page please contact on [email protected] or 8076671483

Buy This Ad Space @$50 per Month, Ad Size 600X200 Contact on: [email protected] or 8076671483

Path variable is set for providing path for all Java tools like java, javac, javap, javah, jar, appletviewer which are used in java programming. All these tools are available in bin folders so we set path upto bin folders.

Classpath variable is set for providing a path for predefined Java classes which is used in our application. All classes are available in lib/rt.jar so we set classpath upto lib/rt.jar.

Cloud computing is the on demand availability of computer system resources, especially data storage and computing power, without direct active management by the user.

College Projects Related to Java, AWT, C Projects for College, C++ Projects for College, Android Projects.

Download Projects

Adsense Advertisements


Buy This ads Space 8076671483

Buy This Ad Space @$120 per Month, Ad Size 300X600 Contact on: [email protected] or 8076671483 Try this Keyword C++ Programs