Program of table of any number in C.

Table : A table is a set of data arranged in rows and columns.

 

Let’s write a program of table of any number in C.

 

Step 1: Let’s open turbo C/C++ and write the following code.

 

// Code

 

// Add preprocessor file

#include<stdio.h>

#include<conio.h>

void main()

{

 

// Declare variable

long int i,n,result;

 

// clear screen

clrscr();

printf(“enter any number : “);

 

// assign value in variable n

scanf(“%li”,&n);

for(i=1;i<=10;i++)

{

result=n*i;

 

//print the result.

printf(“ \n %li”,result);

}

getch();

}

 

 

Step 2: Save it by pressing F2 and name it TABLE.CPP and click on OK.

 

 

Step 3: Now compile it by pressing ALT+ F9 or click on compile for checking errors in program .

 

 

Step 4: After compile ,run program by pressing ALT+R and see the output.

 

 

// Output

 

 

Output

 

I hope this article was helpful.

 

Happy coding.

 

 

Tags: , , , ,