C programming multiplication table of number
In this tutorials,you will learn:-
* To generate multiplication table:-
So guys, before we learn the concept of table program we must to know very well loop concept.
How the loop is execute and what are the first step ,how value is initialize ,and how compiler print the output.
So guys if wanna know to what is loop so you check my previous post where, i explain everything about loop.
So lets start......
Now we are going to print a table of any no..
#include<stdio.h>
#include<conio.h>
void main()
{
int i=1,t,n;
printf("enter the no ");
scanf("%d",&n);
for(i=1;i<=10;i++)
{
t=i*n;
printf("%d=%d*%d\n",t);
}
getch();
}
OUTPUT
enter the no 2
2*1=2
2*2=4
2*3=6
2*4=8
2*5=10
2*6=12
2*7=14
2*8=16
2*9=18
2*10=20
So friends this is the normal\simple method to print a table of any number
* And we are print a table by USER DEFINE FUNCTION:-
So before we start to print a table by user define function we must know about the Function. you can check my previous vedio to learn how function is use in the program.
Lets start,,.....
#include<stdio.h>
#include<conio.h>
void table (int);
void main()
{
int n;
printf("enter no");
scanf("%d",&n);
table(n);
getch();
}
void table (int x)
{
int i,t;
for(i=1;i<=10;i++)
{
t= i*x;
printf("%d=%d*%d\n",x,i,t);
}
}
OUTPUT:-
enter the no 2
2*1=2
2*2=4
2*3=6
2*4=8
2*5=10
2*6=12
2*7=14
2*8=16
2*9=18
2*10=20
c programming language
c programming for prime number
c programming basics
c programming structure
c programming tutorial
c programming array
c programming questions for interview
c programming pdf
for c programming example
c programming examples
c programming questions
c programming interview questions
c programming hello world
what c programming
c programming online compiler
c programming functions
c programming string
c programming online
c programming com…
c programming language
c programming for prime number
c programming basics
c programming structure
c programming tutorial
c programming questions for interview
c programming pdf
for c programming example
c programming examples
c programming questions
c programming interview questions
c programming hello world
what c programming
c programming online compiler
c programming multiplication table of number
c programming examples with output
c programming recursion
0 comments:
Post a Comment
If you have any doubt, please let me know