Tuesday, 7 January 2014

C Program to Print table of any number

C Program to Print table of any number

C Program to Print table of any number. The general concept to generate table of any number is;number multiply from 1 to 10.

Table Program

#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);
}
}

Output



FIND TABLE FO A GIVEN NUM. USING RECURSION

No comments:

Post a Comment