using codeblocks
--------------------------------------------------------------------------------------------------------------
//program to print multiplication table of a number using function
#include<stdio.h> //header file
void m_table(); // function prototype/declaration with return type zero.
int main() //main function
{
m_table(); // function calling.
return 0; //returns 0 value
}
void m_table() // function body line ; also called function definition
{
int i,n; // variable declaration
printf("enter a number\n"); //message display to input a number
scanf("%d",&n); //gets input
for(i=0;i<=10;i++) //loop running from 0 to 10 with increment 1 each time
{
printf("%d*%d=%d\n",n,i,n*i); // displaying all the multiplied numbers
}
}
----------------------------------------------------------------------------------------------
using turboc++
--------------------------------------------------------------------------------------------------------
//program to print multiplication table of a number using function.
#include<stdio.h> //header file
#include<conio.h>
void m_table(); // function prototype/declaration with return type zero.
void main() //main function
{
m_table(); // function calling.
getch(); //returns 0 value
}
void m_table() // function body line ; also called function definition
{
int i,n; // variable declaration
printf("enter a number\n"); //message display to input a number
scanf("%d",&n); //gets input
for(i=0;i<=10;i++) //loop running from 0 to 10 with increment 1 each time
{
printf("%d*%d=%d\n",n,i,n*i); // displaying all the multiplied numbers
}
}
--------------------------------------------------------------------------------------------------------------
//program to print multiplication table of a number using function
#include<stdio.h> //header file
void m_table(); // function prototype/declaration with return type zero.
int main() //main function
{
m_table(); // function calling.
return 0; //returns 0 value
}
void m_table() // function body line ; also called function definition
{
int i,n; // variable declaration
printf("enter a number\n"); //message display to input a number
scanf("%d",&n); //gets input
for(i=0;i<=10;i++) //loop running from 0 to 10 with increment 1 each time
{
printf("%d*%d=%d\n",n,i,n*i); // displaying all the multiplied numbers
}
}
----------------------------------------------------------------------------------------------
using turboc++
--------------------------------------------------------------------------------------------------------
//program to print multiplication table of a number using function.
#include<stdio.h> //header file
#include<conio.h>
void m_table(); // function prototype/declaration with return type zero.
void main() //main function
{
m_table(); // function calling.
getch(); //returns 0 value
}
void m_table() // function body line ; also called function definition
{
int i,n; // variable declaration
printf("enter a number\n"); //message display to input a number
scanf("%d",&n); //gets input
for(i=0;i<=10;i++) //loop running from 0 to 10 with increment 1 each time
{
printf("%d*%d=%d\n",n,i,n*i); // displaying all the multiplied numbers
}
}
No comments:
Post a Comment