C program to find the product of two numbers using functions
In this tutorial, We'll use Functions and Will write programs to find the product of two numbers using functions.
Method No:1
#include<stdio.h>
#include<conio.h>
int product(int a,int b)
{
int c=a*b;
return c;
}
main()
{
int x,y,z;
printf("Enter two numbers:");
scanf("%d %d",&x,&y);
z= product(x,y);
printf("product=%d",z);
}
_________________________________________________
Method No:2
#include<stdio.h>#include<conio.h>int pro(int a ,int b){int c=a*b;return c;}main(){int pro(int,int);int x,y,z;printf("Enter a number:");scanf("%d",&x);printf("Enter a number:");scanf("%d",&y);z=pro(x,y);printf("product=%d",z);}
_________________________________________________
1 Comments
nice bro
ReplyDelete